import java.io.*;
import java.util.*;

public class famine_vd_slow {
	BufferedReader in;
	StringTokenizer str;
	PrintWriter out;
	String SK;

	String next() throws IOException {
		while ((str == null) || (!str.hasMoreTokens())) {
			SK = in.readLine();
			if (SK == null)
				return null;
			str = new StringTokenizer(SK);
		}
		return str.nextToken();
	}

	int nextInt() throws IOException {
		return Integer.parseInt(next());
	}

	double nextDouble() throws IOException {
		return Double.parseDouble(next());
	}

	long nextLong() throws IOException {
		return Long.parseLong(next());
	}

	char[][] b;

	int fine(int num, int mask) {
		for (int i = 0; i < n; i++) {
			if (mask % 2 == 0 && b[i][num] == '+') {
				return 0;
			}
			if (mask % 2 == 1 && b[i][num] == '-') {
				return 0;
			}
			mask /= 2;
		}
		return 1;
	}

	int n, m;

	int MOD = (int) (1e+9 + 7);

	boolean check(int v1, int v2) {
		for (int i = 0; i < n - 1; i++) {
			int res = v1 % 2 + v2 % 2 + v1 / 2 % 2 + v2 / 2 % 2;
			if (res != 2) {
				return false;
			}
			v1 /= 2;
			v2 /= 2;
		}
		return true;
	}

	void solve() throws IOException {
		n = nextInt();
		m = nextInt();
		int[] pows = new int[n + 1];
		pows[0] = 1;
		for (int i = 1; i <= n; i++) {
			pows[i] = pows[i - 1] * 2;
		}
		int[][] a = new int[pows[n]][pows[n]];
		for (int i = 0; i < pows[n]; i++) {
			for (int j = 0; j < pows[n]; j++) {
				if (check(i, j)) {
					a[i][j] = 1;
				} else {
					a[i][j] = 0;
				}
			}
		}
		b = new char[n][m];
		for (int i = 0; i < n; i++) {
			b[i] = next().toCharArray();
		}

		int[][] res = new int[m][pows[n]];
		for (int mask = 0; mask < pows[n]; mask++) {
			res[0][mask] = fine(0, mask);
		}
		System.err.println(fine(1,4));
		System.err.println(fine(0,3));
		for (int i = 1; i < m; i++) {
			for (int m1 = 0; m1 < pows[n]; m1++) {
				if (fine(i, m1) == 1) {
					for (int m2 = 0; m2 < pows[n]; m2++) {
						res[i][m1] = (res[i][m1] + res[i - 1][m2] * a[m1][m2])
								% MOD;
					}
				}
			}
		}
		int rs = 0;
		for (int m1 = 0; m1 < pows[n]; m1++) {
			rs = (rs + res[m - 1][m1]) % MOD;
		}
		out.println(rs);
	}

	void run() throws IOException {
		in = new BufferedReader(new FileReader("famine.in"));
		out = new PrintWriter("famine.out");
		solve();
		out.close();
	}

	public static void main(String[] args) throws IOException {
		new famine_vd_slow().run();
	}

}