#include <bits/stdc++.h>
using namespace std;
const int P = 1e9 + 7;
void Add(int& x, int y) {
  if ((x += y) >= P) x -= P;
}
int n, m, dp[255][1 << 15][2][2];
char A[255][255], ctt[255][255];
int main() {
  cin >> n >> m;
  memset(A, 'x', sizeof A);
  for (int i = (1), iend = (n); i <= iend; ++i) scanf("%s", A[i] + 1);
  if (n < m) {
    for (int i = (1), iend = (m); i <= iend; ++i)
      for (int j = (1), jend = (n); j <= jend; ++j) ctt[i][j] = A[j][i];
    memcpy(A, ctt, sizeof A), swap(n, m);
  }
  dp[0][0][0][0] = 1;
  for (int i = (1), iend = (n); i <= iend; ++i) {
    for (int j = (1), jend = (m); j <= jend; ++j) {
      auto lst = dp[(i - 1) * m + j - 1], cur = dp[(i - 1) * m + j];
      int x;
      for (int S = (0), Send = ((1 << m) - 1); S <= Send; ++S) {
        if (A[i][j] == 'x') {
          int p = S & ~(1 << (j - 1));
          for (int t = (0), tend = (1); t <= tend; ++t)
            for (int o = (0), oend = (1); o <= oend; ++o)
              Add(cur[p][o][0], lst[S][o][t]);
          continue;
        }
        if (j == 1)
          for (int t = (0), tend = (1); t <= tend; ++t)
            Add(lst[S][t][0], lst[S][t][1]), lst[S][t][1] = 0;
        x = lst[S][0][0];
        if (x)
          Add(cur[S | 1 << (j - 1)][0][1], x),
              Add(cur[S][~S >> (j - 1) & 1][0], x);
        x = lst[S][0][1];
        if (x) Add(cur[S | 1 << (j - 1)][0][1], x), Add(cur[S][0][1], x);
        x = lst[S][1][0];
        if (x) Add(cur[S | 1 << (j - 1)][1][1], x);
        if (S >> (j - 1) & 1) Add(cur[S][1][0], x);
        x = lst[S][1][1];
        if (x) Add(cur[S | 1 << (j - 1)][1][1], x), Add(cur[S][1][1], x);
      }
    }
  }
  int res = 0;
  for (int S = (0), Send = ((1 << m) - 1); S <= Send; ++S)
    for (int p = (0), pend = (1); p <= pend; ++p)
      for (int q = (0), qend = (1); q <= qend; ++q)
        Add(res, dp[n * m][S][p][q]);
  cout << res << endl;
  return 0;
}
