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 <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
using ll = long long;
using ii = pair<int, int>;
using vi = vector<int>;
using vii = vector<ii>;
const int mod = 1000000007;
inline void add(int& x, int y) {
  x += y;
  if (x >= mod) x -= mod;
  if (x < 0) x += mod;
}
inline int mul(int x, int y) { return ((ll)x * y) % mod; }
int gcd(int a, int b) {
  if (b) return gcd(b, a % b);
  return a;
}
int power(int a, int p) {
  int ret = 1;
  while (p) {
    if (p & 1) ret = mul(ret, a);
    a = mul(a, a);
    p /= 2;
  }
  return ret;
}
int phi(int n) {
  int ret = n;
  int i = 2;
  if (n % i == 0) {
    ret -= ret / i;
    while (n % i == 0) n /= i;
  }
  for (i = 3; i * i <= n; i++)
    if (n % i == 0) {
      ret -= ret / i;
      while (n % i == 0) n /= i;
    }
  if (n > 1) ret -= ret / n;
  return ret;
}
int DP[1001][1001];
int D[1001];
bool Edge[1000][1000];
bool isE(int x, int y) {
  if (x > y) return Edge[y][x];
  return Edge[x][y];
}
vector<bool> Visited;
int cnt;
int m;
void dfs(int x) {
  if (Visited[x]) return;
  cnt++;
  Visited[x] = true;
  for (int i = 0; i < m; i++)
    if (isE(x, i)) dfs(i);
}
vector<int> getCS() {
  vi ret;
  Visited.clear();
  Visited.resize(m);
  for (int i = 0; i < m; i++)
    if (Visited[i] == 0) {
      cnt = 0;
      dfs(i);
      ret.push_back(cnt);
    }
  return ret;
}
int main() {
  int n;
  cin >> m >> n;
  for (int i = 0; i < m; i++)
    for (int j = i + 1; j < m; j++) Edge[i][j] = true;
  vector<string> second(n);
  for (auto& ss : second) cin >> ss;
  for (int j = 0; j < m; j++)
    for (int k = j + 1; k < m; k++) {
      for (auto& ss : second)
        if (ss[j] != ss[k]) {
          Edge[j][k] = false;
          break;
        }
    }
  int ans = 1;
  auto CS = getCS();
  int mx = 1;
  for (auto x : CS) mx = max(mx, x);
  DP[1][1] = 1;
  D[1] = 1;
  for (int i = 2; i <= mx; i++) {
    D[i] = 2;
    DP[i][1] = 1;
    DP[i][i] = 1;
    for (int j = 2; j < i; j++) {
      add(DP[i][j], DP[i - 1][j - 1]);
      add(DP[i][j], mul(j, DP[i - 1][j]));
      add(D[i], DP[i][j]);
    }
  }
  for (auto s : CS) ans = mul(ans, D[s]);
  cout << ans << endl;
  return 0;
}
