#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
long long n, m;
long long dp[251][1 << 15][2];
vector<vector<char>> grid;
vector<long long> bad;
long long solve(long long col, long long row_mask, long long unprotected) {
  if (unprotected >= 2) return 0;
  if (col == m) return 1;
  if (dp[col][row_mask][unprotected] != -1)
    return dp[col][row_mask][unprotected];
  long long ans = 0;
  for (long long i = 0; i < 1 << n; i++) {
    long long curr = row_mask | i;
    if ((i & bad[col]) < i) continue;
    curr &= bad[col];
    long long curr_unprotected = 0;
    bool ok = false;
    for (long long j = 0; j < n; j++) {
      if (grid[j][col] == 'x')
        ok = false;
      else {
        if (i & (1 << j))
          ok = true;
        else if (row_mask & (1 << j)) {
        } else if (!ok)
          curr_unprotected++;
      }
    }
    ans = (ans + solve(col + 1, curr, unprotected + curr_unprotected)) % MOD;
  }
  return dp[col][row_mask][unprotected] = ans;
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  vector<string> v(n);
  for (string &i : v) cin >> i;
  if (n > m) {
    grid.resize(m, vector<char>(n));
    for (long long j = 0; j < m; j++) {
      for (long long i = 0; i < n; i++) {
        grid[j][i] = v[i][j];
      }
    }
    swap(n, m);
  } else {
    grid.resize(n, vector<char>(m));
    for (long long i = 0; i < n; i++) {
      for (long long j = 0; j < m; j++) {
        grid[i][j] = v[i][j];
      }
    }
  }
  bad.resize(m);
  for (long long i = 0; i < m; i++) {
    long long curr_bad = 0;
    for (long long j = 0; j < n; j++) {
      if (grid[j][i] == 'x') curr_bad |= (1ll << j);
    }
    bad[i] = curr_bad ^ ((1ll << 17) - 1);
  }
  memset(dp, -1, sizeof(dp));
  cout << solve(0, 0, 0) << endl;
  return 0;
}
