#include <bits/stdc++.h>
const int mo = 1e9 + 7;
using namespace std;
char s[55][1050];
int bl[1050], tot, n, m, g[1050][1050], f[1050], mark[1050], ans = 1;
int same(int x, int y) {
  for (int i = 1; i <= n; ++i)
    if (s[i][x] != s[i][y]) return 0;
  return 1;
}
int main() {
  cin >> m >> n;
  for (int i = 1; i <= n; ++i) scanf("%s", s[i]);
  for (int i = 0; i < m; ++i) {
    for (int j = 0; j < i; ++j)
      if (same(j, i)) {
        bl[i] = bl[j];
        break;
      }
    if (!bl[i]) bl[i] = ++tot;
  }
  g[0][0] = f[0] = 1;
  for (int i = 1; i <= m; ++i)
    for (int j = 1; j <= i; ++j)
      g[i][j] = (1ll * g[i - 1][j] * j + g[i - 1][j - 1]) % mo,
      (f[i] += g[i][j]) %= mo;
  for (int i = 0; i < m; ++i) ++mark[bl[i]];
  for (int i = 0; i < m; ++i) ans = 1ll * ans * f[mark[i]] % mo;
  cout << ans;
  return 0;
}
