You are given an integer m.

Let M = 2m - 1.

You are also given a set of n integers denoted as the set T. The integers will be provided in base 2 as n binary strings of length m.

A set of integers S is called "good" if the following hold. 

  1. If <image>, then <image>. 
  2. If <image>, then <image>
  3. <image>
  4. All elements of S are less than or equal to M. 



Here, <image> and <image> refer to the bitwise XOR and bitwise AND operators, respectively.

Count the number of good sets S, modulo 109 + 7.

Input

The first line will contain two integers m and n (1 ≤ m ≤ 1 000, 1 ≤ n ≤ min(2m, 50)).

The next n lines will contain the elements of T. Each line will contain exactly m zeros and ones. Elements of T will be distinct.

Output

Print a single integer, the number of good sets modulo 109 + 7. 

Examples

Input

5 3
11010
00101
11000


Output

4


Input

30 2
010101010101010010101010101010
110110110110110011011011011011


Output

860616440

Note

An example of a valid set S is {00000, 00101, 00010, 00111, 11000, 11010, 11101, 11111}.
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
template <class T>
using V = vector<T>;
template <class T>
using VV = V<V<T>>;
constexpr ll TEN(int n) { return (n == 0) ? 1 : 10 * TEN(n - 1); }
template <class T, class U>
void chmin(T& t, const U& u) {
  if (t > u) t = u;
}
template <class T, class U>
void chmax(T& t, const U& u) {
  if (t < u) t = u;
}
template <class T, class U>
ostream& operator<<(ostream& os, const pair<T, U>& p) {
  os << "(" << p.first << "," << p.second << ")";
  return os;
}
template <class T>
ostream& operator<<(ostream& os, const vector<T>& v) {
  os << "{";
  for (int i = 0; i < (v.size()); i++) {
    if (i) os << ",";
    os << v[i];
  }
  os << "}";
  return os;
}
template <unsigned int MOD>
struct ModInt {
  using uint = unsigned int;
  using ull = unsigned long long;
  using M = ModInt;
  uint v;
  ModInt(ll _v = 0) { set_norm(_v % MOD + MOD); }
  M& set_norm(uint _v) {
    v = (_v < MOD) ? _v : _v - MOD;
    return *this;
  }
  explicit operator bool() const { return v != 0; }
  M operator+(const M& a) const { return M().set_norm(v + a.v); }
  M operator-(const M& a) const { return M().set_norm(v + MOD - a.v); }
  M operator*(const M& a) const { return M().set_norm(ull(v) * a.v % MOD); }
  M operator/(const M& a) const { return *this * a.inv(); }
  M& operator+=(const M& a) { return *this = *this + a; }
  M& operator-=(const M& a) { return *this = *this - a; }
  M& operator*=(const M& a) { return *this = *this * a; }
  M& operator/=(const M& a) { return *this = *this / a; }
  M operator-() const { return M() - *this; }
  M& operator++(int) { return *this = *this + 1; }
  M& operator--(int) { return *this = *this - 1; }
  M pow(ll n) const {
    if (n < 0) return inv().pow(-n);
    M x = *this, res = 1;
    while (n) {
      if (n & 1) res *= x;
      x *= x;
      n >>= 1;
    }
    return res;
  }
  M inv() const {
    ll a = v, b = MOD, p = 1, q = 0, t;
    while (b != 0) {
      t = a / b;
      swap(a -= t * b, b);
      swap(p -= t * q, q);
    }
    return M(p);
  }
  bool operator==(const M& a) const { return v == a.v; }
  bool operator!=(const M& a) const { return v != a.v; }
  friend ostream& operator<<(ostream& os, const M& a) { return os << a.v; }
  static uint get_mod() { return MOD; }
};
using Mint = ModInt<1000000007>;
const int maxv = 1000010;
V<Mint> fact(maxv), ifact(maxv), inv(maxv);
void init() {
  fact[0] = 1;
  for (int i = 1; i < maxv; ++i) {
    fact[i] = fact[i - 1] * i;
  }
  ifact[maxv - 1] = fact[maxv - 1].inv();
  for (int i = maxv - 2; i >= 0; --i) {
    ifact[i] = ifact[i + 1] * (i + 1);
  }
  for (int i = 1; i < maxv; ++i) {
    inv[i] = ifact[i] * fact[i - 1];
  }
}
Mint comb(int n, int r) {
  if (n < 0 || r < 0 || r > n) return Mint(0);
  return fact[n] * ifact[r] * ifact[n - r];
}
int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  init();
  int n, k;
  cin >> n >> k;
  V<string> s(k);
  for (int i = 0; i < (k); i++) cin >> s[i];
  map<string, int> T;
  for (int i = 0; i < (n); i++) {
    string t;
    for (int j = 0; j < (k); j++) {
      t.push_back(s[j][i]);
    }
    T[t]++;
  }
  V<Mint> dp(n + 1);
  dp[0] = 1;
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= i; ++j) {
      dp[i] += dp[i - j] * comb(i - 1, j - 1);
    }
  }
  Mint ans = 1;
  for (auto& [ss, c] : T) {
    ans *= dp[c];
  }
  cout << ans << endl;
  return 0;
}
