#include <bits/stdc++.h>
using namespace std;
template <typename X>
void MA(X &a, X b) {
  a = max(a, b);
}
template <typename X>
void MI(X &a, X b) {
  a = min(a, b);
}
template <typename X>
void clr(X &x, int a) {
  memset(x, a, sizeof(a));
};
int cond = 0, multi = 0, gcj = 0;
struct solver_t;
solver_t *solver;
struct solver_t {
  long long DW[1011][1011] = {};
  long long SP[1011] = {};
  void solve() {
    const int MOD = (int)1e9 + 7;
    DW[0][0] = 1;
    for (auto i = (0); i < (1001); ++i)
      for (auto j = (0); j < (1001); ++j) {
        DW[i + 1][j + 1] = (DW[i + 1][j + 1] + DW[i][j]) % MOD;
        DW[i + 1][j] = (DW[i + 1][j] + DW[i][j]) % MOD;
      }
    {
      if (cond)
        cerr << 41 << " "
             << "DW[30][26]"
             << " " << DW[30][26] << endl;
    };
    SP[0] = 1;
    for (auto sp = (1); sp <= (1000); ++sp) {
      for (auto ch = (1); ch <= (sp); ++ch) {
        SP[sp] = (SP[sp] + SP[sp - ch] * DW[sp - 1][ch - 1]) % MOD;
      }
    }
    int M, N;
    cin >> M >> N;
    set<long long> Q;
    vector<vector<int> > XX;
    for (auto i = (0); i < (N); ++i) {
      string x;
      cin >> x;
      vector<int> X;
      long long val = 0;
      for (char ch : x) {
        X.push_back(ch - '0');
        val = val * 2 + ch - '0';
      }
      Q.insert(val);
      XX.push_back(X);
      for (int &v : X) v ^= 1;
      XX.push_back(X);
    }
    XX.push_back(vector<int>(M));
    bool vis[1005] = {};
    long long res = 1;
    for (auto i = (0); i < (M); ++i)
      if (!vis[i]) {
        int cnt = 1;
        vis[i] = 1;
        for (auto j = (0); j < (M); ++j)
          if (!vis[j]) {
            bool ok = 1;
            for (auto k = (0); k < (XX.size()); ++k) {
              if (XX[k][i] != XX[k][j]) {
                ok = 0;
                break;
              }
            }
            if (ok) {
              vis[j] = 1;
              cnt++;
            }
          }
        {
          if (cond)
            cerr << 85 << " "
                 << "cnt"
                 << " " << cnt << endl;
        };
        res = (res * SP[cnt]) % MOD;
      }
    cout << res << "\n";
  }
};
void gen() {}
void brute() {}
int main(int argc, char **argv) {
  for (auto i = (1); i <= (argc - 1); ++i)
    if (argv[i] == string("q")) cond = 1 << 30;
  for (auto i = (1); i <= (argc - 1); ++i)
    if (argv[i] == string("gen")) {
      gen();
      exit(0);
    }
  for (auto i = (1); i <= (argc - 1); ++i)
    if (argv[i] == string("brute")) {
      brute();
      exit(0);
    }
  ios::sync_with_stdio(false), cin.tie(0);
  cout.setf(ios::fixed), cout.precision(10);
  int t;
  if (multi || gcj)
    cin >> t;
  else
    t = 1;
  for (auto i = (1); i <= (t); ++i) {
    if (cond) cerr << 111 << " " << i << endl;
    if (gcj) cout << "Case #" << i << ": ";
    solver = new solver_t();
    solver->solve();
  }
  return 0;
}
