#include <bits/stdc++.h>
using namespace std;
long long n, m;
char s[300][300], tmp[300][300];
bool used[300][300];
long long dp[256][1 << 15][2][2];
long long nxtS(long long i, long long j, long long S) {
  if (i + 1 < n && j == m - 1) {
    for (long long nj = (long long)(0); nj < (long long)(m); nj++) {
      if (s[i + 1][nj] == 'x') {
        S &= ~(1LL << nj);
      }
    }
  }
  return S;
}
int main() {
  scanf("%lld%lld", &n, &m);
  for (long long i = (long long)(0); i < (long long)(n); i++) scanf("%s", s[i]);
  if (n < m) {
    for (long long i = (long long)(0); i < (long long)(n); i++)
      for (long long j = (long long)(0); j < (long long)(m); j++) {
        tmp[j][i] = s[i][j];
      }
    memcpy(s, tmp, sizeof(s));
    swap(n, m);
  }
  dp[0][0][0][0] = 1;
  for (long long i = (long long)(0); i < (long long)(n); i++)
    for (long long j = (long long)(0); j < (long long)(m); j++)
      for (long long S = (long long)(0); S < (long long)(1LL << m); S++) {
        for (long long k = (long long)(0); k < (long long)(2); k++)
          for (long long l = (long long)(0); l < (long long)(2); l++) {
            long long idx = i * m + j;
            if (s[i][j] == 'x') {
              dp[idx + 1][nxtS(i, j, S)][k][0] =
                  (dp[idx + 1][nxtS(i, j, S)][k][0] + dp[idx][S][k][l]) %
                  1000000007;
            } else {
              if (((S >> j) & 1LL) == 0 && l == 0 && k == 0) {
                dp[idx + 1][nxtS(i, j, S)][k + 1][l] =
                    (dp[idx + 1][nxtS(i, j, S)][k + 1][l] + dp[idx][S][k][l]) %
                    1000000007;
              } else if (((S >> j) & 1LL) == 1 || l == 1) {
                dp[idx + 1][nxtS(i, j, S)][k][l && j != m - 1] =
                    (dp[idx + 1][nxtS(i, j, S)][k][l && j != m - 1] +
                     dp[idx][S][k][l]) %
                    1000000007;
              }
              dp[idx + 1][nxtS(i, j, S | (1 << j))][k][j != m - 1] =
                  (dp[idx + 1][nxtS(i, j, S | (1 << j))][k][j != m - 1] +
                   dp[idx][S][k][l]) %
                  1000000007;
            }
          }
      }
  long long res = 0;
  for (long long S = (long long)(0); S < (long long)(1 << m); S++)
    for (long long k = (long long)(0); k < (long long)(2); k++)
      for (long long l = (long long)(0); l < (long long)(2); l++) {
        res = (res + dp[n * m][S][k][l]) % 1000000007;
      }
  cout << res << endl;
  return 0;
}
