#include <bits/stdc++.h>
using namespace std;
int n, m;
const long long MD = 1e9 + 7;
char A[251][251];
long long dp[251][2][1 << 16];
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) cin >> A[i][j];
  if (m > n) {
    for (int i = 1; i <= n; i++)
      for (int j = 1; j <= m; j++)
        if (j > i) {
          swap(A[i][j], A[j][i]);
        }
    swap(n, m);
  }
  dp[0][0][0] = 1;
  int cnt = 1;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      if (j == 1) {
        for (int b = 0; b < 2; b++)
          for (int bit = 0; bit < 1 << m; bit++) {
            dp[cnt - 1][b][2 * bit] += dp[cnt - 1][b][2 * bit + 1];
            dp[cnt - 1][b][2 * bit + 1] = 0;
          }
      }
      if (A[i][j] == 'x') {
        for (int b = 0; b < 2; b++)
          for (int bit = 0; bit < 1 << (m + 1); bit++)
            dp[cnt][b][bit & (~(1 ^ (1 << j)))] += dp[cnt - 1][b][bit];
      } else {
        for (int b = 0; b < 2; b++)
          for (int bit = 0; bit < 1 << (m + 1); bit++) {
            int B = b + !((bit & 1) | (bit & (1 << j)));
            if (B < 2) {
              dp[cnt][B][bit] += dp[cnt - 1][b][bit];
            }
          }
        for (int b = 0; b < 2; b++)
          for (int bit = 0; bit < 1 << (m + 1); bit++) {
            dp[cnt][b][bit | (1 ^ (1 << j))] += dp[cnt - 1][b][bit];
          }
      }
      for (int b = 0; b < 2; b++)
        for (int bit = 0; bit < 1 << (m + 1); bit++) dp[cnt][b][bit] %= MD;
      cnt++;
    }
  long long ans = 0;
  for (int b = 0; b < 2; b++)
    for (int bit = 0; bit < 1 << (m + 1); bit++) ans += dp[m * n][b][bit];
  ans %= MD;
  cout << ans << endl;
}
