#include <bits/stdc++.h>
using namespace std;
int w, h;
int dp[251][1 << 16][2][2];
char f[251][251];
int solve(int pos, int rowMask, bool colBlock, bool unguarded) {
  if (pos == w * h) return 1;
  if (dp[pos][rowMask][colBlock][unguarded] != -1)
    return dp[pos][rowMask][colBlock][unguarded];
  int xp = pos / h;
  int yp = pos % h;
  if (f[xp][yp] == 'x') {
    int nextMask = rowMask & (((1 << 16) - 1) ^ (1 << yp));
    return dp[pos][rowMask][colBlock][unguarded] =
               solve(pos + 1, nextMask, 0, unguarded);
  }
  int ans = 0;
  if ((rowMask & (1 << yp)) >= 1 or colBlock) {
    bool nextBlock = (colBlock and (yp < h - 1));
    ans += solve(pos + 1, rowMask, nextBlock, unguarded);
  } else if (!unguarded) {
    bool nextBlock = (colBlock and yp < h - 1);
    ans += solve(pos + 1, rowMask, nextBlock, 1);
  }
  if (f[xp][yp] == '.') {
    int nextMask = rowMask | (1 << yp);
    bool nextBlock = (yp < h - 1);
    ans += solve(pos + 1, nextMask, nextBlock, unguarded);
    ans %= (int)1e9 + 7;
  }
  return dp[pos][rowMask][colBlock][unguarded] = ans;
}
int main() {
  int n, m;
  cin >> n >> m;
  h = min(n, m);
  w = max(n, m);
  for (int i = 0; i < 251; i++) {
    for (int j = 0; j < (1 << 16); j++) {
      for (int k = 0; k < 2; k++) {
        for (int l = 0; l < 2; l++) dp[i][j][k][l] = -1;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (n > m)
        cin >> f[i][j];
      else
        cin >> f[j][i];
    }
  }
  cout << solve(0, 0, false, false) << endl;
  return 0;
}
