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>
ostream &operator<<(ostream &os, const vector<T> &vec) {
  os << '{';
  for (int i = (0), __i = (((int)(vec).size())); i < __i; i++) {
    os << vec[i];
    if (i + 1 != ((int)(vec).size())) os << ',';
  }
  os << '}';
  return os;
}
template <class T1, class T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &par) {
  os << '(' << par.first << ',' << par.second << ')';
  return os;
}
int gcd(int x, int y) { return y ? gcd(y, x % y) : abs(x); }
template <class T>
T sqr(T x) {
  return x * x;
}
const long long MOD = 1e9 + 7;
long long bin_pow(long long base, long long p) {
  if (p == 1) return base;
  if (p % 2 == 0) {
    long long t = bin_pow(base, p / 2);
    return t * t % MOD;
  } else
    return bin_pow(base, p - 1) * base % MOD;
}
long long inverse_element(long long x) { return bin_pow(x, MOD - 2); }
long long add(long long a, long long b) { return (a + b) % MOD; }
long long sub(long long a, long long b) { return (MOD + a - b) % MOD; }
long long divide(long long a, long long b) {
  return a * inverse_element(b) % MOD;
}
long long mult(long long a, long long b) { return (a * b) % MOD; }
long long code[1010];
long long bell[1010][1010];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long m, n;
  cin >> m >> n;
  bell[0][0] = 1;
  long long last = 1;
  for (int i = (1), __i = (m); i < __i; i++) {
    bell[i][0] = last;
    for (int j = (1), __j = (i + 1); j < __j; j++) {
      last = bell[i][j] = add(bell[i - 1][j - 1], bell[i][j - 1]);
    }
  }
  for (int i = (0), __i = (n); i < __i; i++) {
    string s;
    cin >> s;
    for (int j = (0), __j = (m); j < __j; j++) {
      code[j] |= (long long)(s[j] - '0') << i;
    }
  }
  sort(code, code + m);
  long long res = 1;
  long long cnt = 1;
  for (int i = (1), __i = (m); i < __i; i++) {
    if (code[i] == code[i - 1])
      cnt++;
    else {
      res = mult(res, bell[cnt - 1][cnt - 1]);
      cnt = 1;
    }
  }
  res = mult(res, bell[cnt - 1][cnt - 1]);
  cout << res;
  return 0;
}
