#include <bits/stdc++.h>
using namespace std;
const int maxmask = 1 << 16;
const int maxn = 255;
const int mod = 1e9 + 7;
int dp[maxmask][2][2], curdp[maxmask][2][2];
int a[maxn][maxn], b[maxn][maxn];
void summ(int &a, int b) { a = (a + b) % mod; }
int main() {
  int ans = 0;
  string s;
  int n, m, i, j;
  cin >> n >> m;
  for (i = 0; i < n; i++) {
    cin >> s;
    for (j = 0; j < m; j++) a[i][j] = (s[j] == '.' ? 0 : 1);
  }
  if (n < m) {
    swap(n, m);
    for (i = 0; i < n; i++)
      for (j = 0; j < m; j++) b[i][j] = a[j][i];
    for (i = 0; i < n; i++)
      for (j = 0; j < m; j++) a[i][j] = b[i][j];
  }
  int mask, is, f;
  dp[0][0][0] = 1;
  for (i = 0; i < n; i++)
    for (j = 0; j < m; j++) {
      for (mask = 0; mask < 1 << m; mask++)
        for (is = 0; is < 2; is++)
          for (f = 0; f < 2; f++)
            if (dp[mask][is][f] != 0) {
              int curis = (j ? is : 0);
              bool check = (mask >> j) & 1;
              if (a[i][j] == 1) {
                int curmask = mask & (~(1 << j));
                summ(curdp[curmask][0][f], dp[mask][is][f]);
                continue;
              }
              if (curis || check) summ(curdp[mask][curis][f], dp[mask][is][f]);
              if (curis == 0 && !check && f == 0)
                summ(curdp[mask][0][1], dp[mask][is][f]);
              int curmask = mask | (1 << j);
              summ(curdp[curmask][1][f], dp[mask][is][f]);
            }
      ans = 0;
      for (mask = 0; mask < maxmask; mask++)
        for (is = 0; is < 2; is++)
          for (f = 0; f < 2; f++) {
            dp[mask][is][f] = curdp[mask][is][f], curdp[mask][is][f] = 0;
            summ(ans, dp[mask][is][f]);
          }
    }
  cout << ans;
  return 0;
}
