#include <bits/stdc++.h>
using namespace std;
const int M = 255, K = 1 << 16;
const int mod = 1e9 + 7;
int dp[2][K][2][2];
int ans;
int a[M][M], b[M][M];
char s[M];
int n, m;
void print(int S) {
  int j;
  for (j = 0; j <= m - 1; j++)
    if (1 << j & S)
      printf("1");
    else
      printf("0");
}
int main() {
  int i, j, S, o, opt, lopt, nS, no, nopt;
  int now, pre;
  int li, lj;
  scanf("%d%d", &n, &m);
  for (i = 1; i <= n; i++) {
    scanf("%s", s + 1);
    for (j = 1; j <= m; j++) a[i][j] = s[j] == '.' ? 0 : 1;
  }
  if (n < m) {
    for (i = 1; i <= n; i++)
      for (j = 1; j <= m; j++) b[j][i] = a[i][j];
    swap(n, m);
    memset(a, 0, sizeof(a));
    for (i = 1; i <= n; i++)
      for (j = 1; j <= m; j++) a[i][j] = b[i][j];
  }
  dp[0][0][0][0] = 1;
  pre = 0;
  now = 1;
  lopt = 0;
  li = 0;
  lj = m;
  for (i = 1; i <= n; i++)
    for (j = 1; j <= m; j++) {
      memset(dp[now], 0, sizeof(dp[now]));
      for (S = 0; S <= (1 << m) - 1; S++)
        for (o = 0; o <= 1; o++)
          for (opt = 0; opt <= 1; opt++) {
            if (!dp[pre][S][o][opt]) continue;
            nopt = opt & lopt;
            if (a[i][j] == 1) {
              nS = (S | (1 << j - 1)) ^ (1 << j - 1);
              dp[now][nS][o][nopt] =
                  (dp[now][nS][o][nopt] + dp[pre][S][o][opt]) % mod;
            } else {
              nS = S | (1 << j - 1);
              dp[now][nS][o][1] =
                  (dp[now][nS][o][1] + dp[pre][S][o][opt]) % mod;
              no = o + (!(nopt || ((1 << j - 1) & S)));
              if (no <= 1)
                dp[now][S][no][nopt] =
                    (dp[now][S][no][nopt] + dp[pre][S][o][opt]) % mod;
            }
          }
      swap(now, pre);
      if (j == m || a[i][j] == 1)
        lopt = 0;
      else
        lopt = 1;
      li = i;
      lj = j;
    }
  for (S = 0; S <= (1 << m) - 1; S++)
    for (o = 0; o <= 1; o++)
      for (opt = 0; opt <= 1; opt++) ans = (ans + dp[pre][S][o][opt]) % mod;
  printf("%d\n", ans);
}
