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;
template <class T>
void readi(T &x) {
  T input = 0;
  bool negative = false;
  char c = ' ';
  while (c < '-') {
    c = getchar();
  }
  if (c == '-') {
    negative = true;
    c = getchar();
  }
  while (c >= '0') {
    input = input * 10 + (c - '0');
    c = getchar();
  }
  if (negative) {
    input = -input;
  }
  x = input;
}
template <class T>
void printi(T output) {
  if (output == 0) {
    putchar('0');
    return;
  }
  if (output < 0) {
    putchar('-');
    output = -output;
  }
  int aout[20];
  int ilen = 0;
  while (output) {
    aout[ilen] = ((output % 10));
    output /= 10;
    ilen++;
  }
  for (int i = ilen - 1; i >= 0; i--) {
    putchar(aout[i] + '0');
  }
  return;
}
template <class T>
void ckmin(T &a, T b) {
  a = min(a, b);
}
template <class T>
void ckmax(T &a, T b) {
  a = max(a, b);
}
long long randomize(long long mod) {
  return ((1ll << 30) * rand() + (1ll << 15) * rand() + rand()) % mod;
}
const long double PI = 4.0 * atan(1.0);
const long double EPS = 1e-20;
long long normalize(long long x, long long mod = 1000000007) {
  return (((x % mod) + mod) % mod);
}
int N, Q, K;
bitset<1013> head;
vector<bitset<1013> > arr;
bitset<1013> child[1013];
vector<int> edge[1013];
int id[1013];
int sz[1013];
long long bell[1013];
long long choose[1013][1013];
long long ans = 1;
void dfs(int u) {
  if (id[u] != -1) {
    return;
  }
  id[u] = K;
  sz[K]++;
  for (int v : edge[u]) {
    dfs(v);
  }
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  srand(time(0));
  if (fopen("cf908e.in", "r")) {
    freopen("cf908e.in", "r", stdin);
    freopen("cf908e.out", "w", stdout);
  }
  cin >> N >> Q;
  for (int i = 0; i < N; i++) {
    head[i] = 1;
  }
  while (Q--) {
    string s;
    cin >> s;
    bitset<1013> tempb;
    for (int i = 0; i < N; i++) {
      tempb[i] = (s[i] - '0');
    }
    arr.push_back(tempb);
    arr.push_back(head ^ tempb);
  }
  for (int i = 0; i < N; i++) {
    child[i] = head;
    for (auto x : arr) {
      if (!x[i]) {
        continue;
      }
      child[i] &= x;
    }
  }
  for (int i = 0; i < N; i++) {
    for (int j = i + 1; j < N; j++) {
      if (child[i][j]) {
        edge[i].push_back(j);
        edge[j].push_back(i);
      }
    }
  }
  for (int i = 0; i < N; i++) {
    id[i] = -1;
  }
  for (int i = 0; i <= N; i++) {
    choose[i][0] = 1;
    choose[i][i] = 1;
    for (int j = 1; j < i; j++) {
      choose[i][j] = choose[i - 1][j] + choose[i - 1][j - 1];
      choose[i][j] %= 1000000007;
    }
  }
  bell[0] = 1;
  for (int i = 1; i <= N; i++) {
    for (int j = 0; j < i; j++) {
      bell[i] += (choose[i - 1][j]) * bell[j];
      bell[i] %= 1000000007;
    }
  }
  for (int i = 0; i < N; i++) {
    if (id[i] == -1) {
      dfs(i);
      K++;
    }
  }
  for (int i = 0; i < K; i++) {
    ans *= bell[sz[i]];
    ans %= 1000000007;
  }
  cout << ans << '\n';
  return 0;
}
