#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int n, m;
int C[1005][1005], f[1005];
long long mask[1005];
char s[1005];
map<long long, int> h;
map<long long, int>::iterator it;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  for (; ch < '0' || ch > '9'; ch = getchar())
    if (ch == '-') f = -1;
  for (; ch >= '0' && ch <= '9'; ch = getchar()) x = x * 10 + ch - '0';
  return x * f;
}
int main() {
  m = read(), n = read();
  for (int i = 1; i <= n; i++) {
    scanf("%s", s + 1);
    for (int j = 1; j <= m; j++)
      if (s[j] == '1') mask[j] |= 1ll << (i - 1);
  }
  for (int i = 1; i <= m; i++) ++h[mask[i]];
  for (int i = 0; i <= m; i++) {
    C[i][0] = 1;
    for (int j = 1; j <= i; j++)
      C[i][j] = (C[i - 1][j - 1] + C[i - 1][j]) % mod;
  }
  f[0] = 1;
  for (int i = 1; i <= m; i++)
    for (int j = 0; j < i; j++) f[i] = (f[i] + 1ll * C[i - 1][j] * f[j]) % mod;
  int ans = 1;
  for (it = h.begin(); it != h.end(); ++it)
    ans = 1ll * ans * f[it->second] % mod;
  printf("%d\n", ans);
  return 0;
}
