#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000 * 1000 * 1000 + 7;
const int nmax = 1005;
string st;
long long s[nmax][nmax];
long long v[nmax], cat[nmax];
long long i, j, ans;
int secv, n, m;
int main() {
  cin >> n >> m;
  for (i = 1; i <= m; i++) {
    cin >> st;
    for (j = 0; j < st.size(); j++)
      if (st[j] == '1') v[j + 1] += (1LL << i);
  }
  sort(v + 1, v + n + 1);
  s[0][0] = 1;
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= n; j++) {
      s[i][j] = (1LL * j * s[i - 1][j] + s[i - 1][j - 1]) % mod;
      cat[i] = (cat[i] + s[i][j]) % mod;
    }
  }
  v[0] = v[n + 1] = -1;
  ans = 1;
  for (i = 1; i <= n; i++) {
    if (v[i] == v[i - 1])
      secv++;
    else
      secv = 1;
    if (v[i + 1] != v[i]) {
      ans = (1LL * ans * cat[secv]) % mod;
    }
  }
  cout << ans;
  return 0;
}
