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 _R(T &x) {
  cin >> x;
}
void _R(int &x) { scanf("%d", &x); }
void _R(int64_t &x) { scanf("%lld", &x); }
void _R(double &x) { scanf("%lf", &x); }
void _R(char &x) { scanf(" %c", &x); }
void _R(char *x) { scanf("%s", x); }
void R() {}
template <class T, class... U>
void R(T &head, U &...tail) {
  _R(head);
  R(tail...);
}
template <class T>
void _W(const T &x) {
  cout << x;
}
void _W(const int &x) { printf("%d", x); }
void _W(const int64_t &x) { printf("%lld", x); }
void _W(const double &x) { printf("%.16f", x); }
void _W(const char &x) { putchar(x); }
void _W(const char *x) { printf("%s", x); }
template <class T, class U>
void _W(const pair<T, U> &x) {
  _W(x.first);
  putchar(' ');
  _W(x.second);
}
template <class T>
void _W(const vector<T> &x) {
  for (auto i = x.begin(); i != x.end(); _W(*i++))
    if (i != x.cbegin()) putchar(' ');
}
void W() {}
template <class T, class... U>
void W(const T &head, const U &...tail) {
  _W(head);
  putchar(sizeof...(tail) ? ' ' : '\n');
  W(tail...);
}
template <class T, class... U>
void DEBUG(const T &head, const U &...tail) {}
int MOD = 1e9 + 7;
void ADD(int64_t &x, int64_t v) {
  x = (x + v) % MOD;
  if (x < 0) x += MOD;
}
const int SIZE = 1024;
char s[SIZE][SIZE];
int64_t dp[SIZE][SIZE], ss[SIZE];
int main() {
  dp[0][0] = 1;
  for (int i = (1); i < (SIZE); ++i) {
    for (int j = (1); j < (SIZE); ++j) {
      dp[i][j] = dp[i - 1][j - 1];
      ADD(dp[i][j], dp[i - 1][j] * j);
      ADD(ss[i], dp[i][j]);
    }
  }
  int m, n;
  R(m, n);
  for (int i = 0; i < (n); ++i) scanf("%s", (s[i]));
  vector<int64_t> gg;
  for (int i = 0; i < (m); ++i) {
    int64_t v = 0;
    for (int j = 0; j < (n); ++j) {
      if (s[j][i] == '1') v |= 1LL << j;
    }
    gg.push_back(v);
  }
  sort((gg).begin(), (gg).end());
  int64_t an = 1;
  for (int i = 0, j; i < ((int)(gg).size()); i = j) {
    for (j = i; j < ((int)(gg).size()) && gg[i] == gg[j]; j++)
      ;
    an = an * ss[j - i] % MOD;
  }
  W(an);
  return 0;
}
