#include <bits/stdc++.h>
using namespace std;
int R, C;
char g[250][251];
char tmp[250][251];
int dp[250][1 << 15][2][2];
const int M = 1000000007;
int calc(int r, int c, int mask, bool e, bool l) {
  if (c == C) return calc(r + 1, 0, mask, e, false);
  if (r == R) return 1;
  int &ret = dp[r * C + c][mask][e][l];
  if (ret != -1) return ret;
  ret = 0;
  if (g[r][c] == '.') {
    if (l || ((mask >> c) & 1)) ret = calc(r, c + 1, mask, e, l);
    ret += calc(r, c + 1, mask | (1 << c), e, true);
    if (ret >= M) ret -= M;
    if (!e && !l && !((mask >> c) & 1)) {
      ret += calc(r, c + 1, mask, true, l);
      if (ret >= M) ret -= M;
    }
  } else {
    ret = calc(r, c + 1, mask & ~(1 << c), e, false);
  }
  return ret;
}
int main() {
  scanf("%d%d", &R, &C);
  for (int i = 0; i < R; ++i) scanf("%s", g[i]);
  if (R < C) {
    for (int i = 0; i < R; ++i)
      for (int j = 0; j < C; ++j) tmp[j][R - i - 1] = g[i][j];
    swap(R, C);
    for (int i = 0; i < R; ++i) reverse(tmp[i], tmp[i] + C);
    for (int i = 0; i < R; ++i)
      for (int j = 0; j < C; ++j) g[i][j] = tmp[i][j];
  }
  memset(dp, -1, sizeof(dp));
  printf("%d\n", calc(0, 0, 0, 0, false));
  return 0;
}
