#include <bits/stdc++.h>
using namespace std;
template <class T>
void splitstr(const string &s, vector<T> &out) {
  istringstream in(s);
  out.clear();
  copy(istream_iterator<T>(in), istream_iterator<T>(), back_inserter(out));
}
template <class T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
static void redirect(int argc, const char **argv) {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  if (argc > 1) {
    static filebuf f;
    f.open(argv[1], ios::in);
    cin.rdbuf(&f);
    if (!cin) {
      cerr << "Failed to open '" << argv[1] << "'" << endl;
      exit(1);
    }
  }
  if (argc > 2) {
    static filebuf f;
    f.open(argv[2], ios::out | ios::trunc);
    cout.rdbuf(&f);
    if (!cout) {
      cerr << "Failed to open '" << argv[2] << "'" << endl;
    }
  }
}
template <typename T, typename C, T Modulus>
class MR {
 private:
  struct tag_plus {};
  struct tag_minus {};
  struct tag_good {};
  T value;
  static_assert(std::numeric_limits<C>::max() / Modulus / Modulus > 0,
                "compute type is too small");
  static_assert(Modulus < std::numeric_limits<T>::max() / 2,
                "storage type is too small");
  void reduce(tag_plus) {
    if (value >= Modulus) value -= Modulus;
  }
  void reduce(tag_minus) {
    if (value < 0) value += Modulus;
  }
  void reduce(tag_good) {}

 public:
  static const T modulus = Modulus;
  MR() : value(0) {}
  MR(C value) : value(value % Modulus) { reduce(tag_minus()); }
  template <typename tag_t>
  MR(T value, tag_t tag) : value(value) {
    reduce(tag);
  }
  MR &operator=(C value) {
    this->value = value % Modulus;
    reduce(tag_minus());
    return *this;
  }
  MR operator+(MR b) const { return MR(value + b.value, tag_plus()); }
  MR operator-(MR b) const { return MR(value - b.value, tag_minus()); }
  MR operator*(MR b) const {
    return MR(C(value) * C(b.value) % Modulus, tag_good());
  }
  MR operator-() const { return MR(-value, tag_minus()); }
  MR &operator+=(MR b) {
    value += b.value;
    reduce(tag_plus());
    return *this;
  }
  MR &operator-=(MR b) {
    value -= b.value;
    reduce(tag_minus());
    return *this;
  }
  MR &operator*=(MR b) {
    value = C(value) * C(b.value) % Modulus;
    return *this;
  }
  bool operator==(MR b) const { return value == b.value; }
  bool operator!=(MR b) const { return value != b.value; }
  T get() const { return value; }
};
template <typename T, typename C, T Modulus>
static inline std::ostream &operator<<(std::ostream &o, MR<T, C, Modulus> mr) {
  return o << mr.get();
}
int main(int argc, const char **argv) {
  redirect(argc, argv);
  int M, N;
  cin >> M >> N;
  map<long long, int> freq;
  vector<string> nums(N);
  for (int i = 0; i < N; i++) cin >> nums[i];
  for (int i = 0; i < M; i++) {
    long long mask = 0;
    for (int j = 0; j < N; j++)
      if (nums[j][i] == '1') mask |= 1LL << j;
    freq[mask]++;
  }
  vector<vector<MR<int, long long, 1000000007>>> choose(
      M + 1, vector<MR<int, long long, 1000000007>>(M + 1));
  for (int i = 0; i <= M; i++) {
    choose[i][0] = choose[i][i] = 1;
    for (int j = 1; j < i; j++)
      choose[i][j] = choose[i - 1][j - 1] + choose[i - 1][j];
  }
  vector<MR<int, long long, 1000000007>> dp(M + 1);
  dp[0] = 1;
  for (int i = 1; i <= M; i++)
    for (int j = 0; j < i; j++) dp[i] += choose[i - 1][j] * dp[i - 1 - j];
  MR<int, long long, 1000000007> ans = 1;
  for (const auto &f : freq) ans *= dp[f.second];
  cout << ans << '\n';
  return 0;
}
