#include <bits/stdc++.h>
using namespace std;
int get() {
  char ch;
  while (ch = getchar(), (ch < '0' || ch > '9') && ch != '-')
    ;
  if (ch == '-') {
    int s = 0;
    while (ch = getchar(), ch >= '0' && ch <= '9') s = s * 10 + ch - '0';
    return -s;
  }
  int s = ch - '0';
  while (ch = getchar(), ch >= '0' && ch <= '9') s = s * 10 + ch - '0';
  return s;
}
const int N = 1005;
const int mo = 1e9 + 7;
long long val[N];
int n, m;
char s[N];
long long f[N][N], c[N];
int main() {
  m = get();
  n = get();
  for (int i = 1; i <= n; i++) {
    scanf("%s", s + 1);
    for (int j = 1; j <= m; j++) val[j] = val[j] << 1 | (s[j] == '1');
  }
  f[1][1] = c[1] = 1;
  for (int i = 2; i <= m; i++) {
    for (int j = 1; j <= i; j++) {
      f[i][j] = (f[i - 1][j] * j + f[i - 1][j - 1]) % mo;
      c[i] = (c[i] + f[i][j]) % mo;
    }
  }
  sort(val + 1, val + 1 + m);
  int lst = 0;
  long long ans = 1;
  for (int i = 1; i <= m; i++) {
    if (i == m || val[i] != val[i + 1]) {
      ans = ans * c[i - lst] % mo;
      lst = i;
    }
  }
  cout << ans << endl;
  return 0;
}
