#include <bits/stdc++.h>
using namespace std;
const int M = 1e9 + 7;
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = 0x3f3f3f3f;
const long long LINF = 1e18;
const int N = 1010;
const long long MOD = 1e9 + 7;
int n, m;
long long S[N][N], bellNumber[N];
map<long long, int> mp;
long long st[N];
char s[N];
void pre() {
  for (int i = 1; i <= m; i++) {
    S[i][1] = 1;
    for (int j = 2; j <= i; j++) {
      S[i][j] = (S[i - 1][j - 1] + j * S[i - 1][j]) % MOD;
    }
    for (int j = 0; j <= i; j++)
      bellNumber[i] = (bellNumber[i] + S[i][j]) % MOD;
  }
}
int main() {
  cin >> m >> n;
  pre();
  for (int i = 0; i < n; i++) {
    scanf("%s", s);
    for (int j = 0; j < m; j++) st[j] = st[j] * 2 + (s[j] - '0');
  }
  for (int i = 0; i < m; i++) mp[st[i]]++;
  long long ans = 1;
  for (auto it : mp) ans = (ans * bellNumber[it.second]) % MOD;
  cout << ans << endl;
  return 0;
}
