#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
const int MAXM = 1024;
long long ster[MAXM][MAXM];
long long bell[MAXM];
void initBell() {
  for (int n = 0; n < (int)(MAXM); n++) {
    ster[n][n] = ster[n][1] = 1;
    for (int k = (2); k < (int)(n); k++)
      ster[n][k] = (ster[n - 1][k - 1] + (k * ster[n - 1][k]) % MOD) % MOD;
  }
  for (int i = 0; i < (int)(MAXM); i++)
    for (int j = 0; j < (int)(i + 1); j++) {
      bell[i] += ster[i][j];
      bell[i] %= MOD;
    }
}
int main() {
  initBell();
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int m, n;
  while (cin >> m >> n) {
    vector<long long> colMask(m, 0);
    for (int i = 0; i < (int)(n); i++) {
      string s;
      cin >> s;
      for (int j = 0; j < (int)(m); j++)
        if (s[j] == '1') colMask[j] |= 1LL << i;
    }
    sort((colMask).begin(), (colMask).end());
    long long ret = 1;
    for (int i = 0; i < m;) {
      int j = i;
      while (j < m && colMask[j] == colMask[i]) j++;
      ret *= bell[j - i];
      ret %= MOD;
      i = j;
    }
    cout << ret << endl;
  }
  return 0;
}
