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 ll = long long;
using namespace std;
ll powmod(ll x, ll y, ll p) {
  assert(0 <= x and x < p);
  assert(0 <= y);
  ll z = 1;
  for (ll i = 1; i <= y; i <<= 1) {
    if (y & i) z = z * x % p;
    x = x * x % p;
  }
  return z;
}
ll modinv(ll x, ll p) {
  assert(x % p != 0);
  return powmod(x, p - 2, p);
}
template <int MOD>
int fact(int n) {
  static vector<int> memo(1, 1);
  while (n >= memo.size()) {
    memo.push_back(memo.back() * (ll)memo.size() % MOD);
  }
  return memo[n];
}
template <int MOD>
int inv_fact(int n) {
  static vector<int> memo(1, 1);
  while (n >= memo.size()) {
    memo.push_back(memo.back() * (ll)modinv(memo.size(), MOD) % MOD);
  }
  return memo[n];
}
template <int MOD>
int choose(int n, int r) {
  if (n < r) return 0;
  return fact<MOD>(n) * (ll)inv_fact<MOD>(n - r) % MOD * (ll)inv_fact<MOD>(r) %
         MOD;
}
template <int MOD>
int bell_number(int n) {
  vector<int> dp(n + 1);
  dp[0] = 1;
  for (int i = 0; (i) < int(n); ++(i)) {
    ll acc = 0;
    for (int j = 0; (j) < int(i + 1); ++(j)) {
      acc += dp[j] * (ll)choose<MOD>(i, j) % MOD;
    }
    dp[i + 1] = acc % MOD;
  }
  return dp[n];
}
constexpr ll mod = 1e9 + 7;
int main() {
  int m, n;
  scanf("%d%d", &m, &n);
  assert(m <= 1000);
  vector<bitset<1000> > t(n);
  for (int y = 0; (y) < int(n); ++(y)) {
    for (int x = 0; (x) < int(m); ++(x)) {
      char c;
      scanf(" %c", &c);
      t[y][x] = (c != '0');
    }
  }
  bitset<1000> mask = (bitset<1000>().flip() << m).flip();
  unordered_set<bitset<1000> > atoms;
  for (int x = 0; (x) < int(m); ++(x)) {
    bitset<1000> acc = mask;
    for (int y = 0; (y) < int(n); ++(y)) {
      acc &= t[y][x] ? t[y] : (~t[y]);
    }
    atoms.insert(acc);
  }
  ll result = 1;
  for (auto atom : atoms) {
    result *= bell_number<mod>(atom.count());
    result %= mod;
  }
  printf("%lld\n", result);
  return 0;
}
