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.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Junior
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskE solver = new TaskE();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskE {
        int MOD = (int) 1e9 + 7;

        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int m = in.nextInt();
            int n = in.nextInt();
            String[] v = new String[n];
            long[] ax = new long[m];
            for (int i = 0; i < n; ++i) {
                v[i] = in.nextString();
                for (int j = 0; j < m; ++j) ax[j] |= (((long) v[i].charAt(j) - '0') << i);
            }
            long[] bell = MathUtils.bellNumberModM(m + 1, MOD);
            Arrays.sort(ax);
            long sol = 1;
            for (int i = 0; i < m; ) {
                int j = i;
                while (j < m && ax[i] == ax[j]) j++;
                sol = MathUtils.mulMod(sol, bell[j - i], MOD);
                i = j;
            }
            out.println(sol);
        }

    }

    static class MathUtils {
        public static long addMod(long a, long b, long md) {
            return (a + b) % md;
        }

        public static long mulMod(long a, long b, long md) {
            return (a * b) % md;
        }

        public static long[][] getCombinationModM(int N, int M) {
            long[][] c = new long[N + 1][N + 1];
            c[0][0] = 1;
            for (int i = 1; i <= N; ++i) {
                for (int j = 0; j <= i; ++j) {
                    if (j == 0 || j == i) c[i][j] = 1;
                    else c[i][j] = addMod(c[i - 1][j], c[i - 1][j - 1], M);
                }
            }
            return c;
        }

        public static long[] bellNumberModM(int N, int M) {
            long[][] comb = getCombinationModM(N + 2, M);
            long[] bell = new long[N + 1];
            bell[0] = 1;
            for (int i = 1; i <= N; ++i) {
                for (int j = 1; j <= i; ++j) {
                    bell[i] = addMod(bell[i], mulMod(bell[i - j], comb[i - 1][j - 1], M), M);
                }
            }
            return bell;
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public String nextString() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            StringBuilder res = new StringBuilder();
            do {
                if (Character.isValidCodePoint(c)) {
                    res.appendCodePoint(c);
                }
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void close() {
            writer.close();
        }

        public void println(long i) {
            writer.println(i);
        }

    }
}

