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 rd(T &ret) {
  ret = 0;
  bool ok = 0, u = 0;
  for (;;) {
    int c = getchar();
    if (c >= '0' && c <= '9')
      ret = (ret << 3) + (ret << 1) + c - '0', ok = 1;
    else if (c == '-')
      u = 1;
    else if (ok) {
      if (u) ret *= -1;
      return;
    }
  }
}
long long pow_mod(long long p, long long n, long long mod) {
  long long ret = 1;
  for (; n; n >>= 1) {
    if (n & 1) ret = ret * p % mod;
    p = p * p % mod;
  }
  return ret;
}
template <class T>
bool chmin(T &a, const T &b) {
  return b < a ? a = b, 1 : 0;
}
template <class T>
bool chmax(T &a, const T &b) {
  return b > a ? a = b, 1 : 0;
}
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
string s[50];
const int mod = (int)1e9 + 7;
void Xor(string &a, const string &b) {
  for (int i = (0); i < (((int)(a).size())); i++) {
    a[i] = (a[i] == '1' && b[i] == '1' ? '1' : '0');
  }
}
namespace bell {
int dp[1005][1005];
void calc(int n, int *bell) {
  dp[1][1] = 1;
  bell[1] = 1;
  for (int i = (2); i < (n + 1); i++) {
    bell[i] = dp[i][1] = dp[i - 1][1];
    for (int j = (2); j < (i + 1); j++) {
      dp[i][j] = (dp[i - 1][j - 1] + (1ll * dp[i - 1][j] * j % mod)) % mod;
      bell[i] = (bell[i] + dp[i][j]) % mod;
    }
  }
}
}  // namespace bell
int bl[1005];
int main() {
  bell::calc(1000, bl);
  int n, m;
  scanf("%d%d", &m, &n);
  for (int i = (0); i < (n); i++) cin >> s[i];
  map<string, int> has;
  string temp(m, '1');
  for (int i = (0); i < (m); i++) {
    string t = temp;
    for (int j = (0); j < (n); j++) {
      if (s[j][i] == '1') Xor(t, s[j]);
    }
    ++has[t];
  }
  long long ans = 1;
  for (auto i : has) {
    ans = ans * bl[i.second] % mod;
  }
  std::cout << (ans) << " ";
  return 0;
}
