#include <bits/stdc++.h>
using namespace std;
const int P = 1e9 + 7;
int n, m;
int A[263][263];
char ch[263][263];
int dp[263][(1 << 15) + 6][2][2];
inline int gt(int i, int j) { return (i - 1) * m + j; }
void Inc(int& x, const int y) { x = (x + y > P ? x + y - P : x + y); }
void solve() {
  cin >> n >> m;
  for (int i = (1), iend = (n); i <= iend; ++i) scanf("%s", ch[i] + 1);
  if (n > m)
    for (int i = (1), iend = (n); i <= iend; ++i)
      for (int j = (1), jend = (m); j <= jend; ++j) A[i][j] = ch[i][j] == 'x';
  else {
    for (int i = (1), iend = (n); i <= iend; ++i)
      for (int j = (1), jend = (m); j <= jend; ++j) A[j][i] = ch[i][j] == 'x';
    swap(n, m);
  }
  assert(m <= 15);
  dp[0][0][0][0] = 1;
  for (int i = (1), iend = (n); i <= iend; ++i)
    for (int j = (1), jend = (m); j <= jend; ++j)
      for (int s = 0; s < (1 << m); ++s) {
        int cur = gt(i, j), las;
        if (j == 1)
          las = gt(i - 1, m);
        else
          las = gt(i, j - 1);
        if (A[i][j]) {
          int tr = s;
          if (tr & (1 << j - 1)) tr ^= (1 << j - 1);
          Inc(dp[cur][tr][0][0], dp[las][s][0][0]),
              Inc(dp[cur][tr][0][0], dp[las][s][1][0]);
          Inc(dp[cur][tr][0][1], dp[las][s][0][1]),
              Inc(dp[cur][tr][0][1], dp[las][s][1][1]);
        } else {
          int tr = s;
          if (j != 1)
            Inc(dp[cur][tr][1][0], dp[las][s][1][0]),
                Inc(dp[cur][tr][1][1], dp[las][s][1][1]);
          if (~s & (1 << j - 1)) {
            Inc(dp[cur][tr][0][1], dp[las][s][0][0]);
            if (j == 1) Inc(dp[cur][tr][0][1], dp[las][s][1][0]);
          } else {
            Inc(dp[cur][tr][0][0], dp[las][s][0][0]),
                Inc(dp[cur][tr][0][1], dp[las][s][0][1]);
            if (j == 1)
              Inc(dp[cur][tr][0][0], dp[las][s][1][0]),
                  Inc(dp[cur][tr][0][1], dp[las][s][1][1]);
          }
          tr |= (1 << j - 1);
          Inc(dp[cur][tr][1][0], dp[las][s][0][0]),
              Inc(dp[cur][tr][1][1], dp[las][s][0][1]);
          Inc(dp[cur][tr][1][0], dp[las][s][1][0]),
              Inc(dp[cur][tr][1][1], dp[las][s][1][1]);
        }
      }
  int res = 0;
  for (int s = 0; s < (1 << m); ++s) {
    res = (res + dp[n * m][s][0][0] * 1ll + dp[n * m][s][0][1] +
           dp[n * m][s][1][0] + dp[n * m][s][1][1]) %
          P;
  }
  cout << res << endl;
}
signed main() { solve(); }
