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 X>
void MA(X &a, X b) {
  a = max(a, b);
}
template <typename X>
void MI(X &a, X b) {
  a = min(a, b);
}
template <typename X>
void clr(X &x, int a) {
  memset(x, a, sizeof(a));
};
int cond = 0, multi = 0, gcj = 0;
struct solver_t;
solver_t *solver;
struct solver_t {
  long long DW[1011][1011] = {};
  long long SP[1011] = {};
  void solve() {
    const int MOD = (int)1e9 + 7;
    DW[0][0] = 1;
    for (auto i = (0); i < (1001); ++i)
      for (auto j = (0); j < (1001); ++j) {
        DW[i + 1][j + 1] = (DW[i + 1][j + 1] + DW[i][j]) % MOD;
        DW[i + 1][j] = (DW[i + 1][j] + DW[i][j]) % MOD;
      }
    {
      if (cond)
        cerr << 41 << " "
             << "DW[30][26]"
             << " " << DW[30][26] << endl;
    };
    SP[0] = 1;
    for (auto sp = (1); sp <= (1000); ++sp) {
      for (auto ch = (1); ch <= (sp); ++ch) {
        SP[sp] = (SP[sp] + SP[sp - ch] * DW[sp - 1][ch - 1]) % MOD;
      }
    }
    int M, N;
    cin >> M >> N;
    set<long long> Q;
    vector<vector<int> > XX;
    for (auto i = (0); i < (N); ++i) {
      string x;
      cin >> x;
      vector<int> X;
      long long val = 0;
      for (char ch : x) {
        X.push_back(ch - '0');
        val = val * 2 + ch - '0';
      }
      Q.insert(val);
      XX.push_back(X);
      for (int &v : X) v ^= 1;
      XX.push_back(X);
    }
    XX.push_back(vector<int>(M));
    bool vis[1005] = {};
    long long res = 1;
    for (auto i = (0); i < (M); ++i)
      if (!vis[i]) {
        int cnt = 1;
        vis[i] = 1;
        for (auto j = (0); j < (M); ++j)
          if (!vis[j]) {
            bool ok = 1;
            for (auto k = (0); k < (XX.size()); ++k) {
              if (XX[k][i] != XX[k][j]) {
                ok = 0;
                break;
              }
            }
            if (ok) {
              vis[j] = 1;
              cnt++;
            }
          }
        {
          if (cond)
            cerr << 85 << " "
                 << "cnt"
                 << " " << cnt << endl;
        };
        res = (res * SP[cnt]) % MOD;
      }
    cout << res << "\n";
  }
};
void gen() {}
void brute() {}
int main(int argc, char **argv) {
  for (auto i = (1); i <= (argc - 1); ++i)
    if (argv[i] == string("q")) cond = 1 << 30;
  for (auto i = (1); i <= (argc - 1); ++i)
    if (argv[i] == string("gen")) {
      gen();
      exit(0);
    }
  for (auto i = (1); i <= (argc - 1); ++i)
    if (argv[i] == string("brute")) {
      brute();
      exit(0);
    }
  ios::sync_with_stdio(false), cin.tie(0);
  cout.setf(ios::fixed), cout.precision(10);
  int t;
  if (multi || gcj)
    cin >> t;
  else
    t = 1;
  for (auto i = (1); i <= (t); ++i) {
    if (cond) cerr << 111 << " " << i << endl;
    if (gcj) cout << "Case #" << i << ": ";
    solver = new solver_t();
    solver->solve();
  }
  return 0;
}
