#include <bits/stdc++.h>
using namespace std;
int n, m, b[1005][1005], ans, c[1005];
long long a[1005];
char s[1005];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    scanf("%s", s + 1);
    for (int j = 1; j <= n; j++) a[j] = a[j] * 2 | (s[j] == '1');
  }
  sort(a + 1, a + n + 1);
  b[0][0] = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= i; j++) {
      b[i][j] = (b[i - 1][j - 1] + 1ll * b[i - 1][j] * j) % 1000000007;
      c[i] = (c[i] + b[i][j]) % 1000000007;
    }
  }
  int now = 0, ans = 1;
  for (int i = 1; i <= n; i++) {
    now++;
    if (i == n || a[i] != a[i + 1]) {
      ans = 1ll * ans * c[now] % 1000000007;
      now = 0;
    }
  }
  printf("%d\n", ans);
}
