#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int n, m;
int f[2][1 << 16][2][2];
char G[252][252], t[252][252];
inline int ADD(int x, int y) { return x + y >= mod ? x + y - mod : x + y; }
inline void rotate() {
  for (int j = 1; j <= m; j++)
    for (int i = 1; i <= n; i++) t[j][i] = G[i][j];
  swap(n, m);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) G[i][j] = t[i][j];
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%s", G[i] + 1);
  if (n < m) rotate();
  int now = 0, lim = (1 << m) - 1;
  f[now][0][0][0] = 1;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      now ^= 1;
      memset(f[now], 0, sizeof(f[now]));
      for (int s = 0; s <= lim; s++)
        for (int t1 = 0; t1 < 2; t1++)
          for (int t2 = 0; t2 < 2; t2++) {
            if (!f[now ^ 1][s][t1][t2]) continue;
            int res = f[now ^ 1][s][t1][t2];
            if (G[i][j] == 'x') {
              int t = s & (lim ^ (1 << j - 1));
              f[now][t][0][t2] = ADD(f[now][t][0][t2], res);
            } else {
              if (t1 || (s & (1 << j - 1)))
                f[now][s][t1][t2] = ADD(f[now][s][t1][t2], res);
              else if (!t2)
                f[now][s][t1][t2 | 1] = ADD(f[now][s][t1][t2 | 1], res);
              f[now][s | (1 << j - 1)][t1 | 1][t2] =
                  ADD(f[now][s | (1 << j - 1)][t1 | 1][t2], res);
            }
          }
      if (j == m) {
        for (int s = 0; s <= lim; s++)
          for (int t2 = 0; t2 < 2; t2++)
            f[now][s][0][t2] = ADD(f[now][s][0][t2], f[now][s][1][t2]),
            f[now][s][1][t2] = 0;
      }
    }
  int ans = 0;
  for (int s = 0; s <= lim; s++)
    for (int t1 = 0; t1 < 2; t1++)
      for (int t2 = 0; t2 < 2; t2++) ans = ADD(ans, f[now][s][t1][t2]);
  printf("%d", ans);
  return 0;
}
