#include <bits/stdc++.h>
using namespace std;
void read(bool out = 0) {}
char c[300][300];
vector<vector<vector<vector<vector<int> > > > > dp;
int n, m;
int ans(int x, int y, int bitmask, int pro, int one) {
  if (y == m) {
    if (x == n - 1)
      return 1;
    else
      return ans(x + 1, 0, bitmask, 0, one);
  }
  if (dp[x][y][bitmask][pro][one] == -1) {
    int tmp = 0;
    if (c[x][y] == 'x')
      tmp = ans(x, y + 1, bitmask & (1 << y) ? bitmask ^ (1 << y) : bitmask, 0,
                one);
    else {
      if (pro || bitmask & (1 << y)) {
        tmp = ans(x, y + 1, bitmask, pro, one);
        tmp %= 1000000007;
        tmp += ans(x, y + 1, bitmask | (1 << y), 1, one);
      } else {
        if (one)
          tmp = ans(x, y + 1, bitmask | (1 << y), 1, one);
        else {
          tmp = ans(x, y + 1, bitmask | (1 << y), 1, one);
          tmp %= 1000000007;
          tmp += ans(x, y + 1, bitmask, pro, 1);
        }
      }
    }
    dp[x][y][bitmask][pro][one] = tmp % 1000000007;
  }
  return dp[x][y][bitmask][pro][one];
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  read();
  cin >> n >> m;
  if (n < m) {
    for (int i = 0; i < n; i++)
      for (int j = 0; j < m; j++) cin >> c[j][i];
    swap(n, m);
  } else {
    for (int i = 0; i < n; i++)
      for (int j = 0; j < m; j++) cin >> c[i][j];
  }
  dp = vector<vector<vector<vector<vector<int> > > > >(
      n, vector<vector<vector<vector<int> > > >(
             m, vector<vector<vector<int> > >(
                    1 << m, vector<vector<int> >(2, vector<int>(2, -1)))));
  cout << ans(0, 0, 0, 0, 0) << "\n";
}
