#include <bits/stdc++.h>
using namespace std;
const int N = 250, S = 1 << 15, M = 1e9 + 7;
char tmp[N][N], g[N][N];
int dp[S][2][2][2][16];
int n, m;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) {
    scanf(" %s", tmp[i]);
    for (int j = 0; j < m; j++) g[i][j] = tmp[i][j];
  }
  if (n < m) {
    for (int i = 0; i < n; i++)
      for (int j = 0; j < m; j++) g[j][i] = tmp[i][j];
    swap(n, m);
  }
  for (int x = n; x >= 0; x--) {
    for (int y = m; y >= 0; y--) {
      for (int msk = S - 1; msk >= 0; msk--) {
        for (int r = 0; r < 2; r++) {
          for (int o = 0; o < 2; o++) {
            int &ret = dp[msk][r][o][x & 1][y];
            if (x == n) {
              ret = 1;
              continue;
            }
            if (y == m) {
              ret = dp[msk][0][o][(x + 1) & 1][0];
              continue;
            }
            if (g[x][y] == '.') {
              ret = dp[msk | (1 << y)][1][o][x & 1][y + 1];
              if (r || (msk & (1 << y)))
                ret = (ret + dp[msk][r][o][x & 1][y + 1]) % M;
              else if (!o)
                ret = (ret + dp[msk][r][1][x & 1][y + 1]) % M;
            } else
              ret = dp[msk & (~(1 << y))][0][o][x & 1][y + 1];
          }
        }
      }
    }
  }
  cout << dp[0][0][0][0][0];
  return 0;
}
