#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const int N = 300;
char str[N][N];
int a[N][N];
long long f[2][1 << 15][2][2];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) scanf("%s", str[i]);
  if (n >= m) {
    for (int i = 0; i < n; i++)
      for (int j = 0; j < m; j++) a[i][j] = (str[i][j] == '.');
  } else {
    for (int i = 0; i < n; i++)
      for (int j = 0; j < m; j++) a[j][i] = (str[i][j] == '.');
    swap(n, m);
  }
  int maxn = (1 << m);
  f[0][0][0][0] = 1ll;
  int now = 0;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (a[i][j]) {
        memset(f[now ^ 1], 0ll, sizeof(f[now ^ 1]));
        for (int k = 0; k < maxn; k++)
          for (int t = 0; t < 2; t++)
            for (int t1 = 0; t1 < 2; t1++)
              for (int t2 = 0; t2 < 2; t2++) {
                int have = ((k & (1 << j)) | (t << j)) != 0;
                if (!have) have = t1;
                if (t2 + (have ^ 1) > 1) continue;
                (f[now ^ 1][k | (t << j)][(t1 | t) & (j != m - 1)]
                  [t2 + (have ^ 1)] += f[now][k][t1][t2]) %= mod;
              }
        now ^= 1;
      } else {
        memset(f[now ^ 1], 0ll, sizeof(f[now ^ 1]));
        for (int k = 0; k < maxn; k++)
          for (int t1 = 0; t1 < 2; t1++)
            for (int t2 = 0; t2 < 2; t2++)
              (f[now ^ 1][k - (k & (1 << j))][0][t2] += f[now][k][t1][t2]) %=
                  mod;
        now ^= 1;
      }
  long long ans = 0ll;
  for (int i = 0; i < maxn; i++)
    (ans += f[now][i][0][0] + f[now][i][0][1]) %= mod;
  cout << ans << endl;
  return 0;
}
