#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline T qmin(const T &a, const T &b) {
  return a < b ? a : b;
}
template <typename T>
inline T qmax(const T &a, const T &b) {
  return a > b ? a : b;
}
template <typename T>
inline void getmin(T &a, const T &b) {
  if (a > b) a = b;
}
template <typename T>
inline void getmax(T &a, const T &b) {
  if (a < b) a = b;
}
inline void fileio(string s) {
  freopen((s + ".in").c_str(), "r", stdin);
  freopen((s + ".out").c_str(), "w", stdout);
}
const int inf = (int)1e9 + 7;
const long long linf = (long long)1e17 + 7;
const int mod = 1e9 + 7;
const int M = 1005, N = 55;
long long g[M], f[M][M];
int cnt[M];
long long comb[M], ans;
char tmp[M];
int m, n;
int main() {
  scanf("%d%d", &m, &n);
  for (register int i = 0; i < (n); ++i) {
    scanf("%s", tmp);
    for (register int j = 0; j < (m); ++j)
      comb[j] |= (long long)(tmp[j] - '0') << i;
  }
  for (register int i = 0; i < (m); ++i) {
    for (register int j = (0); j <= (i); ++j) {
      if (comb[i] != comb[j]) continue;
      ++cnt[j];
      break;
    }
  }
  g[0] = f[0][0] = 1;
  for (register int i = (1); i <= (m); ++i) {
    for (register int j = (1); j <= (i); ++j) {
      f[i][j] = (f[i - 1][j] * j % mod + f[i - 1][j - 1]) % mod;
      g[i] += f[i][j];
    }
    g[i] %= mod;
  }
  ans = 1;
  for (register int i = 0; i < (m); ++i) ans = ans * g[cnt[i]] % mod;
  printf("%lld\n", ans);
  return 0;
}
