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;
int m, n, nums[1010][35], P[1010] = {0}, nCr[1010][1010], basis[1010][35],
                          sz = 0, pivots[1010];
char buf[1010];
int main() {
  int mask = 0x1F, shift = 5;
  scanf("%d%d", &m, &n);
  for (int i = 0; i < n; i++) {
    scanf("%s", buf);
    for (int j = 0; j < m; j++) {
      nums[i][j >> shift] |= (buf[j] == '1') << (j & mask);
    }
  }
  nCr[0][0] = 1;
  for (int i = 1; i <= m; i++) {
    nCr[i][0] = nCr[i][i] = 1;
    for (int j = 1; j < i; j++) {
      nCr[i][j] = (nCr[i - 1][j - 1] + nCr[i - 1][j]) % 1000000007;
    }
  }
  P[0] = 1;
  for (int i = 1; i <= m; i++) {
    for (int j = 1; j <= i; j++) {
      P[i] = (P[i] + 1LL * nCr[i - 1][j - 1] * P[i - j]) % 1000000007;
    }
  }
  for (int i = 0; i < m >> shift; i++) nums[n][i] = 0xFFFFFFFF;
  nums[n][m >> shift] = (1 << (m & mask)) - 1;
  for (int i = 0; i < m; i++) pivots[i] = -1;
  for (int i = 0; i < m; i++) {
    int idx = 0;
    while (idx <= n && ((nums[idx][i >> shift] >> (i & mask)) & 1) == 0) {
      idx++;
    }
    if (idx == n + 1) continue;
    for (int i = 0; i < 35; i++) {
      basis[sz][i] = nums[idx][i];
    }
    for (int j = idx; j <= n; j++) {
      if ((nums[j][i >> shift] >> (i & mask)) & 1) {
        for (int i = 0; i < 35; i++) {
          nums[j][i] ^= basis[sz][i];
        }
      }
    }
    pivots[i] = sz;
    sz++;
  }
  for (int i = 0; i < m; i++) {
    if (pivots[i] != -1) {
      int u = pivots[i];
      for (int j = 0; j < sz; j++) {
        if (j != u && ((basis[j][i >> shift] >> (i & mask)) & 1))
          for (int z = 0; z < 35; z++) {
            basis[j][z] ^= basis[u][z];
          }
      }
    }
  }
  for (int i = 0; i < m; i++) {
    if (pivots[i] == -1) {
      int u = -1, v = -1;
      for (int j = 0; j < sz; j++) {
        if ((basis[j][i >> shift] >> (i & mask)) & 1) {
          v = u;
          u = j;
        }
      }
      if (v != -1) {
        for (int z = 0; z < 35; z++) {
          basis[sz][z] = basis[u][z] & basis[v][z];
        }
        for (int j = i + 1; j < m; j++) {
          if (pivots[j] != -1 && ((basis[sz][j >> shift] >> (j & mask)) & 1)) {
            int u = pivots[j];
            for (int k = 0; k < 35; k++) basis[sz][k] ^= basis[u][k];
          }
        }
        for (int j = 0; j < sz; j++) {
          if (basis[j][i >> shift] >> (i & mask) & 1) {
            for (int k = 0; k < 35; k++) {
              basis[j][k] ^= basis[sz][k];
            }
          }
        }
        pivots[i] = sz;
        sz++;
      }
    }
  }
  int ans = 1, num_ones = 0;
  for (int i = 0; i < sz; i++) {
    int no = 0;
    for (int j = 0; j < m; j++) {
      no += (basis[i][j >> shift] >> (j & mask)) & 1;
    }
    num_ones += no;
    ans = 1LL * ans * P[no] % 1000000007;
  }
  ans = 1LL * ans * P[m - num_ones] % 1000000007;
  printf("%d\n", ans);
}
