#include <bits/stdc++.h>
using namespace std;
const int MAXN = 250 + 3;
const int MOD = 1000000007;
char maze[MAXN][MAXN], tmp[MAXN][MAXN];
int N, M, dp[2][1 << 15][2][2];
inline void add(int &x, const int &y) {
  x += y;
  if (x >= MOD) x -= MOD;
}
int main() {
  scanf("%d%d", &N, &M);
  for (int i = 0; i < N; ++i) scanf("%s", maze[i]);
  if (N < M) {
    for (int i = 0; i < N; ++i)
      for (int j = 0; j < M; ++j) tmp[j][i] = maze[i][j];
    memcpy(maze, tmp, sizeof tmp);
    swap(N, M);
  }
  bool now = 0, next = 1;
  dp[now][0][0][0] = 1;
  for (int i = 0; i < N; ++i)
    for (int j = 0; j < M; ++j) {
      for (int s = 0; s < (1 << M); ++s)
        for (int k = 0; k < 2; ++k)
          for (int l = 0; l < 2; ++l) {
            if (maze[i][j] == 'x')
              add(dp[next][s & (~0 ^ (1 << j))][0][l], dp[now][s][k][l]);
            else {
              int gg = (~s >> j & 1) && (k == 0 || j == 0);
              if (gg + l < 2)
                add(dp[next][s][k & (j > 0)][gg + l], dp[now][s][k][l]);
              add(dp[next][s | (1 << j)][1][l], dp[now][s][k][l]);
            }
          }
      memset((dp[now]), (0), sizeof(dp[now]));
      now ^= 1;
      next ^= 1;
    }
  int ans = 0;
  for (int s = 0; s < (1 << M); ++s)
    for (int k = 0; k < 2; ++k)
      for (int l = 0; l < 2; ++l) ans = (ans + dp[now][s][k][l]) % MOD;
  printf("%d\n", ans);
  return 0;
}
