You are given an integer m.

Let M = 2m - 1.

You are also given a set of n integers denoted as the set T. The integers will be provided in base 2 as n binary strings of length m.

A set of integers S is called "good" if the following hold. 

  1. If <image>, then <image>. 
  2. If <image>, then <image>
  3. <image>
  4. All elements of S are less than or equal to M. 



Here, <image> and <image> refer to the bitwise XOR and bitwise AND operators, respectively.

Count the number of good sets S, modulo 109 + 7.

Input

The first line will contain two integers m and n (1 ≤ m ≤ 1 000, 1 ≤ n ≤ min(2m, 50)).

The next n lines will contain the elements of T. Each line will contain exactly m zeros and ones. Elements of T will be distinct.

Output

Print a single integer, the number of good sets modulo 109 + 7. 

Examples

Input

5 3
11010
00101
11000


Output

4


Input

30 2
010101010101010010101010101010
110110110110110011011011011011


Output

860616440

Note

An example of a valid set S is {00000, 00101, 00010, 00111, 11000, 11010, 11101, 11111}.
#include <bits/stdc++.h>
using namespace std;
int M, N;
char buf[1013];
int G[1013][1013];
int dp[1013][1013];
int mpow(long long x, int k) {
  long long res = 1;
  while (k) {
    if (k & 1) {
      res *= x;
      res %= 1000000007;
    }
    x *= x;
    x %= 1000000007;
    k >>= 1;
  }
  return res;
}
int f[1013], sz[1013];
int fd(int x) {
  if (x == f[x]) {
    return x;
  }
  return f[x] = fd(f[x]);
}
void unite(int a, int b) {
  a = fd(a), b = fd(b);
  if (a != b) {
    f[a] = b;
    sz[b] += sz[a];
  }
}
int main() {
  dp[0][0] = 1;
  for (int i = int(1), __border_righti = int(1013); i < __border_righti; i++) {
    for (int j = int(1), __border_rightj = int(i + 1); j < __border_rightj;
         j++) {
      dp[i][j] = (dp[i - 1][j - 1] + (long long)dp[i - 1][j] * j) % 1000000007;
    }
  }
  scanf("%d%d", &M, &N);
  for (int i = int(0), __border_righti = int(M); i < __border_righti; i++) {
    f[i] = i;
    sz[i] = 1;
  }
  for (int i = int(0), __border_righti = int(N); i < __border_righti; i++) {
    scanf("%s", buf);
    for (int a = int(0), __border_righta = int(M); a < __border_righta; a++) {
      for (int b = int(0), __border_rightb = int(a); b < __border_rightb; b++) {
        if (buf[a] != buf[b]) {
          G[a][b] = G[b][a] = 1;
        }
      }
    }
  }
  int cnt = 0;
  for (int i = int(0), __border_righti = int(M); i < __border_righti; i++) {
    for (int j = int(0), __border_rightj = int(i); j < __border_rightj; j++) {
      if (G[i][j] == 0) {
        unite(i, j);
      }
    }
  }
  int ans = 1;
  for (int i = int(0), __border_righti = int(M); i < __border_righti; i++) {
    if (f[i] == i && sz[i] != 1) {
      long long tmp = 0;
      for (int k = int(1), __border_rightk = int(sz[i] + 1);
           k < __border_rightk; k++) {
        tmp += dp[sz[i]][k];
      }
      tmp %= 1000000007;
      ans = (long long)ans * tmp % 1000000007;
    }
  }
  printf("%d\n", ans);
  return 0;
}
