#include <bits/stdc++.h>
using namespace std;
int n, m;
int fie[251][251];
int tmp[251][251];
long long dp[2][1 << 16][16][2][3];
int main(void) {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) {
    string str;
    cin >> str;
    for (int j = 0; j < m; j++) {
      if (str[j] == '.')
        fie[i][j] = 0;
      else
        fie[i][j] = 1;
    }
  }
  if (n < m) {
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        tmp[j][i] = fie[i][j];
      }
    }
    swap(n, m);
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        fie[i][j] = tmp[i][j];
      }
    }
  }
  dp[0][0][0][0][0] = 1;
  int now = 0, next = 1;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      for (int bit = 0; bit < (1 << m); bit++) {
        for (int k = 0; k < 2; k++) {
          for (int l = 0; l < 2; l++) {
            long long val = dp[now][bit][j][k][l];
            if (j > 0) val = dp[next][bit][j][k][l];
            if (fie[i][j] == 1) {
              int nbit = bit;
              if (nbit >> j & 1) nbit -= (1 << j);
              dp[next][nbit][(j + 1) % m][0][l] =
                  (dp[next][nbit][(j + 1) % m][0][l] + val) % 1000000007LL;
            } else {
              dp[next][bit | (1 << j)][(j + 1) % m][((j + 1) != m) ? 1 : 0][l] =
                  (dp[next][bit | (1 << j)][(j + 1) % m][((j + 1) != m) ? 1 : 0]
                     [l] +
                   val) %
                  1000000007LL;
              if (k == 1 || ((bit >> j) & 1)) {
                dp[next][bit][(j + 1) % m][((j + 1) != m) ? k : 0][l] =
                    (dp[next][bit][(j + 1) % m][((j + 1) != m) ? k : 0][l] +
                     val) %
                    1000000007LL;
              } else {
                dp[next][bit][(j + 1) % m][((j + 1) != m) ? k : 0][l + 1] =
                    (dp[next][bit][(j + 1) % m][((j + 1) != m) ? k : 0][l + 1] +
                     val) %
                    1000000007LL;
              }
            }
          }
        }
      }
    }
    swap(now, next);
    memset(dp[next], 0, sizeof(dp[next]));
  }
  long long res = 0;
  for (int i = 0; i < (1 << m); i++) {
    for (int k = 0; k < 2; k++) {
      res = (res + dp[now][i][0][0][k]) % 1000000007LL;
    }
  }
  printf("%lld\n", res);
  return 0;
}
