#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 10, MN = 255, MS = (1 << 15) + 10, MOD = 1e9 + 7;
int n, m;
char S[MN][MN];
int Base[2][MS], dp[2][2][17][MS];
void ok(int &x) {
  if (x >= MOD) x -= MOD;
}
int main() {
  ios_base ::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> m >> n;
  for (int i = 0; i < m; ++i) {
    string tmp;
    cin >> tmp;
    for (int j = 0; j < n; ++j) S[i][j] = tmp[j];
  }
  if (n >= m) {
    for (int i = 0; i < MN; ++i)
      for (int j = 0; j < i; ++j) swap(S[i][j], S[j][i]);
    swap(n, m);
  }
  for (int msk = 0; msk < (1 << n); ++msk) Base[0][msk] = Base[1][msk] = 1;
  for (int rp = m - 1; ~rp; --rp) {
    string s;
    for (int i = n - 1; ~i; --i) s += S[rp][i];
    memset(dp, 0, sizeof dp);
    for (int msk = 0; msk < (1 << n); ++msk) {
      dp[0][0][0][msk] = Base[0][msk];
      dp[0][1][0][msk] = Base[0][msk];
      dp[1][0][0][msk] = Base[1][msk];
      dp[1][1][0][msk] = Base[1][msk];
    }
    for (int i = 0; i < n; ++i)
      for (int msk = 0; msk < (1 << n); ++msk)
        for (int d1 = 0; d1 < 2; ++d1)
          for (int d2 = 0; d2 < 2; ++d2) {
            if (s[i] == 'x') {
              if (msk & 1 << i)
                dp[d1][d2][i + 1][msk] = dp[d1][0][i][msk ^ (1 << i)];
              else
                dp[d1][d2][i + 1][msk] = dp[d1][0][i][msk];
              continue;
            }
            dp[d1][d2][i + 1][msk] += dp[d1][1][i][msk | (1 << i)];
            ok(dp[d1][d2][i + 1][msk]);
            if (!d2 && !(msk & 1 << i)) {
              if (d1) {
                dp[d1][d2][i + 1][msk] += dp[0][d2][i][msk];
                ok(dp[d1][d2][i + 1][msk]);
              }
            } else {
              dp[d1][d2][i + 1][msk] += dp[d1][d2][i][msk];
              ok(dp[d1][d2][i + 1][msk]);
            }
          }
    for (int msk = 0; msk < (1 << n); ++msk) {
      Base[0][msk] = dp[0][0][n][msk];
      Base[1][msk] = dp[1][0][n][msk];
    }
  }
  cout << Base[1][0] << '\n';
  return 0;
}
