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