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;
const long long inf = 9.2e18;
const int maxn = 1e3 + 70;
const int INF = 2.1e9;
const int maxm = 1e6 + 70;
const int MOD = 1e9 + 7;
const double eps = 1e-7;
const double PI = acos(-1.0);
int n, m, k;
long long fac[maxn], fac_inv[maxn];
void gcd(long long a, long long b, long long &d, long long &x, long long &y) {
  if (!b) {
    d = a;
    x = 1;
    y = 0;
  } else {
    gcd(b, a % b, d, y, x);
    y -= x * (a / b);
  }
}
long long inv(long long a, long long MOD) {
  long long d, x, y;
  gcd(a, MOD, d, x, y);
  return d == 1 ? (x + MOD) % MOD : -1;
}
void get_fac(int b) {
  fac[0] = 1;
  for (int i = 1; i < b; i++) fac[i] = (fac[i - 1] * i) % MOD;
  fac_inv[b - 1] = inv(fac[b - 1], MOD);
  for (int i = b - 2; i >= 0; i--) fac_inv[i] = (i + 1) * fac_inv[i + 1] % MOD;
}
long long C_mod(long long n, long long m, long long MOD) {
  return ((fac[n] * fac_inv[m] % MOD) * fac_inv[n - m]) % MOD;
}
long long bell[maxn], g[maxn];
map<long long, long long> M;
int main() {
  get_fac(maxn);
  bell[0] = 1;
  for (int i = 1; i < maxn; i++) {
    bell[i] = 0;
    for (int j = 0; j < i; j++) {
      bell[i] = (bell[i] + bell[j] * C_mod(i - 1, j, MOD)) % MOD;
    }
  }
  while (cin >> m >> n) {
    M.clear();
    memset(g, 0, sizeof(g));
    for (int i = 0; i < n; i++) {
      string s;
      cin >> s;
      for (int j = 0; j < m; j++) {
        if (s[j] == '1') g[j] |= ((long long)1 << i);
      }
    }
    for (int j = 0; j < m; j++) {
      if (!M.count(g[j]))
        M[g[j]] = 1;
      else
        M[g[j]]++;
    }
    long long ans = 1;
    for (auto it = M.begin(); it != M.end(); it++) {
      ans = (ans * bell[it->second]) % MOD;
    }
    cout << ans << endl;
  }
  return 0;
}
