#include <bits/stdc++.h>
using namespace std;
template <class T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
  os << '{';
  for (int i = (0), __i = (((int)(vec).size())); i < __i; i++) {
    os << vec[i];
    if (i + 1 != ((int)(vec).size())) os << ',';
  }
  os << '}';
  return os;
}
template <class T1, class T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &par) {
  os << '(' << par.first << ',' << par.second << ')';
  return os;
}
int gcd(int x, int y) { return y ? gcd(y, x % y) : abs(x); }
template <class T>
T sqr(T x) {
  return x * x;
}
const long long MOD = 1e9 + 7;
long long bin_pow(long long base, long long p) {
  if (p == 1) return base;
  if (p % 2 == 0) {
    long long t = bin_pow(base, p / 2);
    return t * t % MOD;
  } else
    return bin_pow(base, p - 1) * base % MOD;
}
long long inverse_element(long long x) { return bin_pow(x, MOD - 2); }
long long add(long long a, long long b) { return (a + b) % MOD; }
long long sub(long long a, long long b) { return (MOD + a - b) % MOD; }
long long divide(long long a, long long b) {
  return a * inverse_element(b) % MOD;
}
long long mult(long long a, long long b) { return (a * b) % MOD; }
long long code[1010];
long long bell[1010][1010];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long m, n;
  cin >> m >> n;
  bell[0][0] = 1;
  long long last = 1;
  for (int i = (1), __i = (m); i < __i; i++) {
    bell[i][0] = last;
    for (int j = (1), __j = (i + 1); j < __j; j++) {
      last = bell[i][j] = add(bell[i - 1][j - 1], bell[i][j - 1]);
    }
  }
  for (int i = (0), __i = (n); i < __i; i++) {
    string s;
    cin >> s;
    for (int j = (0), __j = (m); j < __j; j++) {
      code[j] |= (long long)(s[j] - '0') << i;
    }
  }
  sort(code, code + m);
  long long res = 1;
  long long cnt = 1;
  for (int i = (1), __i = (m); i < __i; i++) {
    if (code[i] == code[i - 1])
      cnt++;
    else {
      res = mult(res, bell[cnt - 1][cnt - 1]);
      cnt = 1;
    }
  }
  res = mult(res, bell[cnt - 1][cnt - 1]);
  cout << res;
  return 0;
}
