#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int MAXNM = 252, MAXS = 1 << 15;
void addeq(int &x, int y) {
  x += y;
  if (x >= MOD) {
    x -= MOD;
  }
}
int N, M;
char A[MAXNM][MAXNM];
int cells[MAXNM];
int dp[MAXNM][MAXS][2][2];
int main() {
  scanf("%d %d", &N, &M);
  for (int i = 0; i < N; i++) {
    scanf("%s", A[i]);
  }
  if (N < M) {
    swap(N, M);
    for (int i = 0; i < MAXNM; i++) {
      for (int j = 0; j < i; j++) {
        swap(A[i][j], A[j][i]);
      }
    }
  }
  dp[0][0][0][0] = 1;
  for (int i = 0; i <= N * M; i++) {
    int r = i / M, c = i % M;
    for (int j = 0; j < (1 << M); j++) {
      for (int k = 0; k < 2; k++) {
        for (int m = 0; m < 2; m++) {
          int pdp = dp[i][j][k][m];
          if (!pdp) {
            continue;
          }
          if (A[r][c] == 'x') {
            addeq(dp[i + 1][j & (~(1 << c))][0][m], pdp);
          } else {
            addeq(dp[i + 1][j | (1 << c)][1][m], pdp);
            if (c) {
              bool pro = k || (j & (1 << c));
              if (m + !pro < 2) {
                addeq(dp[i + 1][j][k][m + !pro], pdp);
              }
            } else {
              bool pro = j & (1 << c);
              if (m + !pro < 2) {
                addeq(dp[i + 1][j][0][m + !pro], pdp);
              }
            }
          }
        }
      }
    }
  }
  int ans = 0;
  for (int j = 0; j < (1 << M); j++) {
    for (int k = 0; k < 2; k++) {
      for (int m = 0; m < 2; m++) {
        addeq(ans, dp[N * M][j][k][m]);
      }
    }
  }
  printf("%d\n", ans);
}
