#include <bits/stdc++.h>
using namespace std;
const int N = 255;
const int BASE = 1e9 + 7;
int n, m;
int dp[2][(1 << 15) + 5][2][2];
char S[N][N], T[N][N];
void Rotate() {
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j) T[j][i] = S[i][j];
  swap(n, m);
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j) S[i][j] = T[i][j];
}
void Update(int &a, int b) {
  a += b;
  if (a >= BASE) a -= BASE;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) scanf("%s", S[i] + 1);
  if (n < m) Rotate();
  dp[0][0][0][0] = 1;
  int cur = 0;
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j) {
      cur ^= 1;
      for (int mask = 0; mask < 1 << m; ++mask) {
        int has_up = mask >> (m - 1) & 1;
        for (int has_left = 0; has_left <= 1; ++has_left)
          for (int flag = 0; flag <= 1; ++flag) {
            if (!dp[cur ^ 1][mask][has_left][flag]) continue;
            for (int put = 0; put <= ((S[i][j] == 'x') ? 0 : 1); ++put) {
              bool no_guard = S[i][j] == '.' && !put && !has_up && !has_left;
              if (flag && no_guard) continue;
              int new_mask = (mask << 1) & ((1 << m) - 1);
              if (S[i][j] == '.' && (put || has_up)) new_mask ^= 1;
              Update(dp[cur][new_mask][(has_left || put) && S[i][j] == '.' &&
                                       j != m][flag | no_guard],
                     dp[cur ^ 1][mask][has_left][flag]);
            }
            dp[cur ^ 1][mask][has_left][flag] = 0;
          }
      }
    }
  int ans = 0;
  for (int mask = 0; mask < 1 << m; ++mask)
    for (int has_left = 0; has_left <= 1; ++has_left)
      for (int flag = 0; flag <= 1; ++flag)
        Update(ans, dp[cur][mask][has_left][flag]);
  printf("%d", ans);
  return 0;
}
