#include <bits/stdc++.h>
using namespace std;
const int N = -1;
const int INF = 1.01e9;
const int MOD = 1e9 + 7;
long long rev(long long a, long long m) {
  if (a == 0) return 0;
  return ((1 - rev(m % a, a) * m) / a + m) % m;
}
int main() {
  int n, m;
  cin >> n >> m;
  vector<string> s(m);
  for (int i = 0; i < m; i++) {
    cin >> s[i];
  }
  map<long long, int> comb;
  for (int i = 0; i < n; i++) {
    long long mask = 0;
    for (int j = 0; j < m; j++) {
      if (s[j][i] == '1') {
        mask |= (1ll << (j));
      }
    }
    comb[mask]++;
  }
  vector<long long> fact(n + 1);
  vector<long long> rfact(n + 1);
  fact[0] = 1;
  for (int i = 1; i <= n; i++) {
    fact[i] = fact[i - 1] * i % MOD;
  }
  rfact[n] = rev(fact[n], MOD);
  for (int i = n - 1; i >= 0; i--) {
    rfact[i] = rfact[i + 1] * (i + 1) % MOD;
  }
  auto getC = [&](int nn, int k) {
    assert(0 <= k && k <= nn);
    return fact[nn] * rfact[nn - k] % MOD * rfact[k] % MOD;
  };
  vector<long long> dp(n + 1);
  dp[0] = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= i; j++) {
      dp[i] = (dp[i] + getC(i - 1, j - 1) * dp[i - j]) % MOD;
    }
  }
  long long answer = 1;
  for (auto x : comb) {
    answer = (answer * dp[x.second]) % MOD;
  }
  cout << answer << endl;
  return 0;
}
