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;
class DisjointSet {
 private:
  vector<int> label;

 public:
  DisjointSet() {}
  DisjointSet(int n) { label.assign(n + 7, -1); }
  int find(int x) {
    if (label[x] < 0) return (x);
    label[x] = find(label[x]);
    return (label[x]);
  }
  bool join(int a, int b) {
    int x = find(a);
    int y = find(b);
    if (x == y) return (false);
    if (label[x] > label[y]) swap(x, y);
    label[x] += label[y];
    label[y] = x;
    return (true);
  }
  int getSize(int x) { return (-label[find(x)]); }
};
const long long mod = 1e9 + 7;
long long modular_pow(long long base, long long exponent, long long modulus) {
  long long result = 1;
  while (exponent > 0) {
    if (exponent % 2 == 1) result = (result * base) % modulus;
    exponent = exponent >> 1;
    base = (base * base) % modulus;
  }
  return result;
}
const long long MN = 2010;
long long bin[MN][MN];
long long bell[MN];
void nCk() {
  for (long long i = (0); i < ((long long)2000); i++) {
    for (long long j = (0); j < ((long long)2000); j++) {
      if (i >= j) {
        bin[i][j] = 1;
      } else {
        bin[i][j] = 0;
      }
    }
  }
  long long i, j;
  for (i = 0; i <= (long long)2000; i++) {
    for (j = 0; j <= min(i, (long long)2000); j++) {
      if (j == 0 || j == i)
        bin[i][j] = 1;
      else
        bin[i][j] = (bin[i - 1][j - 1] + bin[i - 1][j]) % mod;
    }
  }
}
void bff() {
  bell[0] = 1;
  for (long long i = (0); i < ((long long)2000); i++) {
    bell[i] = 0;
  }
  bell[0] = 1;
  for (long long i = (1); i < ((long long)2000); i++) {
    for (long long j = 0; j <= i - 1; j++) {
      bell[i] = (bell[i] + (bin[i - 1][j] * bell[j])) % mod;
      bell[i] = bell[i] % mod;
    }
  }
}
void precompute() {
  nCk();
  bff();
}
void output() {
  precompute();
  long long m, n;
  cin >> m >> n;
  string s[n];
  for (long long i = (0); i < (n); i++) {
    cin >> s[i];
  }
  DisjointSet dsu(m);
  for (long long i = (0); i < (m); i++) {
    for (long long j = (i + 1); j < (m); j++) {
      long long c = 1;
      for (long long k = (0); k < (n); k++) {
        if (s[k][i] != s[k][j]) {
          c = 0;
        }
      }
      if (c == 1) {
        dsu.join(i, j);
      }
    }
  }
  map<long long, long long> siz;
  for (long long i = (0); i < (m); i++) {
    siz[dsu.find(i)] = dsu.getSize(dsu.find(i));
  }
  long long ans = 1;
  for (pair<long long, long long> p : siz) {
    ans = (ans * bell[p.second]) % mod;
  }
  cout << ans << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t = 1;
  for (long long i = (0); i < (t); i++) {
    output();
  }
  return 0;
}
