#include <bits/stdc++.h>
using namespace std;
const int maxn = 255;
const int bits = 16;
const int mod = 1000000007;
int dp[maxn][1 << bits][2][2];
char grid[maxn][maxn], tmp[maxn][maxn];
int r, c;
int reset(int mask, int bit) {
  if ((mask >> bit) & 1) return mask ^ (1 << bit);
  return mask;
}
int solve(int x, int y, int mask, int hasL, int notUsed) {
  if (notUsed > 1) return 0;
  if (x == r) return 1;
  int& v = dp[x * c + y][mask][hasL][notUsed];
  if (v != -1) return v;
  long long ans = 0;
  if (grid[x][y] == 'x') {
    if (y == c - 1) {
      ans += solve(x + 1, 0, reset(mask, y), 0, notUsed);
    } else {
      ans += solve(x, y + 1, reset(mask, y), 0, notUsed);
    }
  } else {
    int isProtected = hasL || ((mask >> y) & 1);
    if (y == c - 1) {
      ans += solve(x + 1, 0, mask | (1 << y), 0, notUsed);
      ans += solve(x + 1, 0, mask, 0, notUsed + (!isProtected));
    } else {
      ans += solve(x, y + 1, mask | (1 << y), 1, notUsed);
      ans += solve(x, y + 1, mask, hasL, notUsed + (!isProtected));
    }
  }
  return v = (ans %= mod);
}
int main() {
  scanf("%d %d", &r, &c);
  for (int e = 0; e < r; e++)
    for (int f = 0; f < c; f++) scanf(" %c", &grid[e][f]);
  if (c > r) {
    for (int e = 0; e < r; e++)
      for (int f = 0; f < c; f++) tmp[f][e] = grid[e][f];
    swap(r, c);
    for (int e = 0; e < r; e++)
      for (int f = 0; f < c; f++) grid[e][f] = tmp[e][f];
  }
  memset(dp, -1, sizeof(dp));
  cout << solve(0, 0, 0, 0, 0) << endl;
  return 0;
}
