#include <bits/stdc++.h>
using namespace std;
const int N = 250, S = 1 << 16, M = 1e9 + 7;
char tmp[N][N], g[N][N];
int dp[S][2][2][N];
int n, m;
int calc(int x, int y, int msk, bool r, bool o) {
  if (x == n) return 1;
  if (y == m) return calc(x + 1, 0, msk, 0, o);
  int &ret = dp[msk][r][o][x * m + y];
  if (ret != -1) return ret;
  ret = 0;
  if (g[x][y] == '.') {
    ret = calc(x, y + 1, msk | (1 << y), 1, o);
    if (r || (msk & (1 << y)))
      ret = (ret + calc(x, y + 1, msk, r, o)) % M;
    else if (!o)
      ret = (ret + calc(x, y + 1, msk, r, 1)) % M;
  } else
    ret = calc(x, y + 1, msk & (~(1 << y)), 0, o);
  return ret;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) {
    scanf(" %s", tmp[i]);
    for (int j = 0; j < m; j++) g[i][j] = tmp[i][j];
  }
  if (n < m) {
    for (int i = 0; i < n; i++)
      for (int j = 0; j < m; j++) g[j][i] = tmp[i][j];
    swap(n, m);
  }
  memset(dp, -1, sizeof dp);
  cout << calc(0, 0, 0, 0, 0);
  return 0;
}
