#include <bits/stdc++.h>
using namespace std;
int dp[255][(1 << 16)][2][2];
int n, m;
char str[255][255];
char g[255][255];
int DFS(int pos, int state, int pre, int cnt) {
  int x = pos / m;
  int y = pos % m;
  if (y == 0) pre = 0;
  if (x == n) return 1;
  if (dp[pos][state][pre][cnt] != -1) return dp[pos][state][pre][cnt];
  int tmp = 0;
  if (g[x][y] == 'x')
    return dp[pos][state][pre][cnt] = DFS(pos + 1, state & (~(1 << y)), 0, cnt);
  else {
    tmp = (tmp + DFS(pos + 1, state | (1 << y), 1, cnt)) % 1000000007;
    if (pre == 1 || (state >> y) & 1)
      tmp = (tmp + DFS(pos + 1, state, pre, cnt)) % 1000000007;
    else if (cnt < 1)
      tmp = (tmp + DFS(pos + 1, state, pre, cnt + 1)) % 1000000007;
    return dp[pos][state][pre][cnt] = tmp;
  }
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (m <= 15)
        cin >> g[i][j];
      else
        cin >> g[j][i];
    }
  }
  if (m > 15) swap(n, m);
  memset(dp, -1, sizeof dp);
  DFS(0, 0, 0, 0);
  printf("%d\n", dp[0][0][0][0]);
  return 0;
}
