#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
int n, m;
char s[5005];
long long state[5005];
long long dp[5005][5005];
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++)
      if (s[j] == '1') state[j] |= (1ll << (i - 1));
  }
  dp[0][0] = 1;
  for (int i = 1; i <= n; i++) {
    dp[i][0] = dp[i - 1][i - 1];
    for (int j = 1; j <= n; j++) {
      dp[i][j] = (dp[i - 1][j - 1] + dp[i][j - 1]);
      if (dp[i][j] >= mod) dp[i][j] -= mod;
    }
  }
  sort(state + 1, state + 1 + n);
  long long ans = 1;
  for (int i = 1; i <= n; i++) {
    int j = i;
    for (j = i; state[j] == state[i] && j <= n; j++)
      ;
    ans *= (dp[j - i][0]);
    ans %= mod;
    i = j - 1;
  }
  printf("%I64d\n", ans);
}
