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}.
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Scanner;
import java.util.Set;

public class EntityEnumeration {

	static long R = 1000000007;
	static long[] b;
	static long[][] p;
	public static char[] convert(int a, int f, int m) {
		char[] s = new char[m];
		for(int i = 0; i < m; i++) {
			if(i == a || i == f) {
				s[i] = '1';
			} else {
				s[i] = '0';
			}
		}
		return s;
	}
	
	/*public static long fac(long n, long k) {
		long r = 1, d;
		if( k > n) return 0;
		for(d = 1; d <= k; d++) {
			r *= n--;
			r *= extEuclid(R, d)[1];
			r %= R;
		}
		return r;
	}*/
	
	public static void fac(int m) {
		p = new long[m][m];
		p[0][0] = 1;
		for(int i = 1; i < m; i++) {
			p[i][0] = 1;
			for(int k = 1; k < m; k++) {
				p[i][k] = (p[i-1][k-1] + p[i-1][k]) % R;
			}
		}
	}
	
	public static long[] extEuclid(long a, long b) {
		if(a == 0) { long[] h = {0,1,b}; return h;}
		long[] f = extEuclid(b % a, a);
		long[] r = {f[1] - (b / a) * f[0], f[0], f[2]};
		return r;
	}
	
	public static void bell(int m) {
		fac(m);
		b = new long[m+1];
		b[0] = 1;
		
		for(int n = 1; n < m+1; n++) {
			for(int k = 0; k <= n-1; k++) {
				b[n] += (b[k] * p[n-1][ k]) % R;
				b[n] %= R;
			}
		}
	}
	
	public static boolean and(char[] a, char[] f) {
		for(int i = 0; i < a.length; i++ ) {
			if(a[i] == '1' && f[i] == '1') {
				return true;
			}
		}
		return false;
	}
	
	public static char[] or(char[] a, char[] f) {
		char[] d = new char[a.length];
		for(int i = 0; i < d.length; i++) {
			d[i] = (a[i] == '1' || f[i] == '1') ?  '1' : '0'; 
		}
		return d;
	}
	
	public static boolean id(char[] a, char[] f) {
		for(int i = 0; i < a.length; i++) {
			if(a[i] != f[i]) {
				return false;
			}
		}
		return true;
	}
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int m = sc.nextInt();
		int n = sc.nextInt();
		sc.nextLine();
		List<char[]> s = new ArrayList<>();
		for(int i = 0; i < n; i++) {
			s.add(sc.nextLine().toCharArray());
		}
		
		
		/*m = 1000;
		s = new ArrayList<>();
		char[] r = new char[m];
		for(int i = 0; i < m; i++) {
			r[i] = '1';
		}
		System.out.println(new String(r));
		s.add(r);*/
		
		HashSet<Integer>[] h = new HashSet[m];
		boolean[] isNotValid = new boolean[m];
		
		
		for(int i = 0; i < m-1; i++) {
			if(isNotValid[i]) {
				continue;
			}
			h[i] = new HashSet<>();
			for(int k = i+1; k < m; k++) {
				boolean is = true;
				for(int j = 0; j < n; j++) {
					if(s.get(j)[i] != s.get(j)[k]) {
						is = false;
						break;
					}
				}
				if(is) {
					h[i].add(k);
					isNotValid[k] = true;
				}
			}
		}
		int max = 0;
		for(int i = 0; i < m-1; i++) {
			if(isNotValid[i]) {
				continue;
			}
			max = (max < h[i].size()) ? h[i].size() : max;
		}
		
		bell(max+1);
		long res = 1;
		for(int i = 0; i < m-1; i++) {
			if(isNotValid[i]) {
				continue;
			}
			res *= (b[h[i].size() + 1] % R);
			res = res % R;
		}
		
		/*for(int i = 0; i < max+1; i++) {
			for(int k = 0; k < max+1; k++) {
				System.out.print(p[i][k] + " ");
			}
			System.out.println();
		}*/
		
		
		System.out.println((res + R) % R);
		/*bell(1000);
		for(int i = 0; i < 1000; i++) {
			System.out.println(b[i] + " ");
		}*/
	}
}
