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

public class famine_vd_slow2 {
	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);

	int[] mask1;
	int[] mask2;

	int get(int mask, int i) {
		if ((mask & pows[i]) == 0) {
			return 0;
		} else {
			return 1;
		}
	}

	void gen(int i, int mask, int m1, int m2, int x) {
		if (i < n - 1) {
			if (m2 % 2 == 0 && b[i + 1][x] == '+') {
				return;
			}
			if (m2 % 2 == 1 && b[i + 1][x] == '-') {
				return;
			}
		}
		if (i < n - 2) {
			if (m1 % 2 + m2 % 2 + m1 / 2 % 2 + m2 / 2 % 2 != 2) {
				return;
			}
		}
		if (i == -1) {
			res[x][m2] = (res[x][m2] + res[x - 1][m1]) % MOD;
			return;
		}
		gen(i - 1, mask, m1 * 2 + get(mask, i), m2 * 2 + 1, x);
		gen(i - 1, mask, m1 * 2 + get(mask, i), m2 * 2 + 0, x);
	}

	int[][] res;
	int[] pows;

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

		res = new int[m][pows[n]];
		for (int mask = 0; mask < pows[n]; mask++) {
			res[0][mask] = fine(0, mask);
		}
		for (int i = 0; i < m - 1; i++) {
			for (int mask = 0; mask < pows[n]; mask++) {
				gen(n - 1, mask, 0, 0, i + 1);
			}
		}

		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_slow2().run();
	}

}