#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
char s[255][255], t[255][255];
int dp[256][1 << 16][2][2];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) scanf("%s", t[i]);
  if (m > n) {
    for (int i = 0; i < n; i++)
      for (int j = 0; j < m; j++) s[j][i] = t[i][j];
    swap(n, m);
  } else {
    for (int i = 0; i < n; i++)
      for (int j = 0; j < m; j++) s[i][j] = t[i][j];
  }
  dp[0][0][0][0] = 1;
  for (int x = 0; x < n * m; x++) {
    int r = x / m, c = x % m;
    int nt = 1;
    if ((x + 1) / m != r) nt = 0;
    for (int i = 0; i < (1 << m); i++) {
      for (int j = 0; j < 2; j++) {
        for (int k = 0; k < 2; k++) {
          if (dp[x][i][j][k] == 0) continue;
          if (s[r][c] == 'x') {
            if ((i >> c) & 1)
              dp[x + 1][i ^ (1 << c)][0 & nt][k] =
                  (dp[x + 1][i ^ (1 << c)][0 & nt][k] + dp[x][i][j][k]) % mod;
            else
              dp[x + 1][i][0 & nt][k] =
                  (dp[x + 1][i][0 & nt][k] + dp[x][i][j][k]) % mod;
          } else {
            if ((i >> c) & 1) {
              dp[x + 1][i][1 & nt][k] =
                  (dp[x + 1][i][1 & nt][k] + dp[x][i][j][k]) % mod;
              dp[x + 1][i][j & nt][k] =
                  (dp[x + 1][i][j & nt][k] + dp[x][i][j][k]) % mod;
            } else {
              dp[x + 1][i ^ (1 << c)][1 & nt][k] =
                  (dp[x + 1][i ^ (1 << c)][1 & nt][k] + dp[x][i][j][k]) % mod;
              if (j == 1)
                dp[x + 1][i][j & nt][k] =
                    (dp[x + 1][i][j & nt][k] + dp[x][i][j][k]) % mod;
              else if (k == 0)
                dp[x + 1][i][j & nt][k + 1] =
                    (dp[x + 1][i][j & nt][k + 1] + dp[x][i][j][k]) % mod;
            }
          }
        }
      }
    }
  }
  int ans = 0;
  for (int i = 0; i < (1 << m); i++) {
    for (int j = 0; j < 2; j++) {
      for (int k = 0; k < 2; k++) ans = (ans + dp[n * m][i][j][k]) % mod;
    }
  }
  printf("%d\n", ans);
}
