#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
char s[250][250], t[250][250];
int dp[250][(1 << 15)][2][2];
int add(int x, int y) { return ((x + y) % mod + mod) % mod; }
int mul(int x, int y) { return (long long)x * y % mod; }
int mypow(int x, int c) {
  int ret = 1;
  while (c > 0) {
    if (c & 1) {
      ret = mul(ret, x);
    }
    c /= 2;
    x = mul(x, x);
  }
  return ret;
}
int solveDp(int cur, int bit, int hasLeft, int num, int n, int m) {
  if (cur == n * m) {
    return 1;
  }
  int &ret = dp[cur][bit][hasLeft][num];
  if (ret != -1) {
    return ret;
  }
  ret = 0;
  int y = cur / m, x = cur % m;
  if (s[y][x] == 'x') {
    int nbit = bit * 2;
    if (nbit & (1 << m)) {
      nbit ^= (1 << m);
    }
    int nleft = 0;
    ret = solveDp(cur + 1, nbit, nleft, num, n, m);
  } else {
    int nleft, nbit;
    int top = (bit & (1 << m - 1)) > 0;
    nleft = hasLeft;
    if (cur % m == m - 1) {
      nleft = 0;
    }
    nbit = (bit * 2) + top;
    if (nbit & (1 << m)) {
      nbit ^= (1 << m);
    }
    if (hasLeft || top) {
      ret = add(ret, solveDp(cur + 1, nbit, nleft, num, n, m));
    } else {
      if (num + 1 <= 1) {
        ret = add(ret, solveDp(cur + 1, nbit, nleft, num + 1, n, m));
      }
    }
    nbit = (bit * 2) + 1;
    if (nbit & (1 << m)) {
      nbit ^= (1 << m);
    }
    nleft = 1;
    if (cur % m == m - 1) {
      nleft = 0;
    }
    ret = add(ret, solveDp(cur + 1, nbit, nleft, num, n, m));
  }
  return ret;
}
void solve() {
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; ++i) {
    scanf(" %s", &s[i]);
  }
  if (n < m) {
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < m; ++j) {
        t[j][i] = s[i][j];
      }
    }
    swap(n, m);
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < m; ++j) {
        s[i][j] = t[i][j];
      }
    }
  }
  memset(dp, -1, sizeof(dp));
  printf("%d\n", solveDp(0, 0, 0, 0, n, m));
}
int main() {
  solve();
  return 0;
}
