#include <bits/stdc++.h>
using namespace std;
const int N = 255;
const int MAXS = (1 << 15) + 5;
const int MOD = 1e9 + 7;
template <typename T>
inline void read(T &AKNOI) {
  T x = 0, flag = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') flag = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  AKNOI = flag * x;
}
inline void Inc(int &x, int y) {
  x += y;
  if (x >= MOD) x -= MOD;
}
char mp[N][N], tmp[N];
int n, m, S, dp[2][MAXS][2][2];
void init() {
  read(n);
  read(m);
  if (n >= m) {
    for (int i = 0; i < n; ++i) {
      scanf("%s", mp[i]);
    }
  } else {
    for (int i = 0; i < n; ++i) {
      scanf("%s", tmp);
      for (int j = 0; j < m; ++j) {
        mp[j][i] = tmp[j];
      }
    }
    swap(n, m);
  }
  S = (1 << m);
}
void solve() {
  dp[0][0][0][0] = 1;
  int pre = 0, cur = 1, flag;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      memset(dp[cur], 0, sizeof(dp[cur]));
      for (int s = 0; s < S; ++s) {
        for (int k = 0; k < 2; ++k) {
          for (int t = 0; t < 2; ++t) {
            int x = dp[pre][s][k][t];
            if (!x) continue;
            if (mp[i][j] == 'x') {
              if (s & (1 << j)) {
                Inc(dp[cur][s ^ (1 << j)][0][t], x);
              } else {
                Inc(dp[cur][s][0][t], x);
              }
            } else {
              Inc(dp[cur][s | (1 << j)][1][t], x);
              if (j == 0) {
                flag = ((s >> j) & 1) ^ 1;
                if (t + flag < 2) {
                  Inc(dp[cur][s][0][t + flag], x);
                }
              } else {
                flag = (k || ((s >> j) & 1)) ^ 1;
                if (t + flag < 2) {
                  Inc(dp[cur][s][k][t + flag], x);
                }
              }
            }
          }
        }
      }
      swap(pre, cur);
    }
  }
  int ans = 0;
  for (int s = 0; s < S; ++s) {
    for (int k = 0; k < 2; ++k) {
      for (int t = 0; t < 2; ++t) {
        Inc(ans, dp[pre][s][k][t]);
      }
    }
  }
  printf("%d\n", ans);
}
int main() {
  init();
  solve();
  return 0;
}
