#include <bits/stdc++.h>
using namespace std;
const int N = 250, M = 15, MX = 1 << 15, mod = 1e9 + 7;
int n, m;
char s[N][N];
vector<vector<vector<vector<vector<int> > > > > mem;
int dp(int i, int j, int x, int f, int t) {
  if (t > 1) return 0;
  if (j == m) return dp(i + 1, 0, x, 0, t);
  if (i == n) return 1;
  int &ret = mem[i][j][x][f][t];
  if (ret != -1) return ret;
  ret = 0;
  if (s[i][j] == 'x') return ret = dp(i, j + 1, x & (~(1 << j)), 0, t);
  ret += dp(i, j + 1, x | (1 << j), 1, t);
  ret %= mod;
  if (f || (x & (1 << j))) {
    ret += dp(i, j + 1, x, f, t);
    ret %= mod;
  } else {
    ret += dp(i, j + 1, x, f, t + 1);
    ret %= mod;
  }
  return ret;
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) {
      if (m <= 15)
        cin >> s[i][j];
      else
        cin >> s[j][i];
    }
  if (m > 15) swap(n, m);
  mem.resize(n);
  for (int i = 0; i < n; i++) {
    mem[i].resize(m);
    for (int j = 0; j < m; j++) {
      mem[i][j].resize(1 << m);
      for (int k = 0; k < (1 << m); k++) {
        mem[i][j][k].resize(2);
        for (int l = 0; l < 2; l++) {
          mem[i][j][k][l].resize(2);
          for (int p = 0; p < 2; p++) {
            mem[i][j][k][l][p] = -1;
          }
        }
      }
    }
  }
  cout << dp(0, 0, 0, 0, 0) << endl;
  return 0;
}
