#include <bits/stdc++.h>
template <typename T>
inline void read(T &x) {
  x = 0;
  char c = getchar();
  bool flag = false;
  while (!isdigit(c)) {
    if (c == '-') flag = true;
    c = getchar();
  }
  while (isdigit(c)) x = x * 10 + (c ^ 48), c = getchar();
  if (flag) x = -x;
}
using namespace std;
const int P = 1e9 + 7;
inline void ADD(int &a, int b) {
  a += b;
  if (a >= P) a -= P;
}
int n, m;
char s[253][253];
inline void Trans() {
  if (n >= m) return;
  static char t[253][253];
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      t[j][i] = s[i][j];
    }
  }
  memcpy(s, t, sizeof(t));
  swap(n, m);
}
int f[2][33481][2][2];
int main() {
  read(n), read(m);
  for (int i = 0; i < n; ++i) scanf("%s", s[i]);
  Trans();
  int nwt = 0;
  f[nwt][0][0][0] = 1;
  const int All = (1 << m) - 1;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      nwt ^= 1;
      memset(f[nwt], 0, sizeof(f[nwt]));
      for (int s = 0; s <= All; ++s) {
        for (int a = 0; a < 2; ++a) {
          for (int b = 0; b < 2; ++b) {
            int tmp = f[nwt ^ 1][s][a][b];
            if (!tmp) continue;
            if (::s[i][j] == 'x') {
              int tos = s ^ (((s >> j) & 1) << j);
              ADD(f[nwt][tos][0][b], tmp);
            } else {
              int tb = b + !(((s >> j) & 1) || a);
              if (tb < 2) ADD(f[nwt][s][a][tb], tmp);
              ADD(f[nwt][s | (1 << j)][1][b], tmp);
            }
          }
        }
      }
    }
    for (int s = 0; s <= All; ++s) {
      for (int b = 0; b < 2; ++b) {
        ADD(f[nwt][s][0][b], f[nwt][s][1][b]);
        f[nwt][s][1][b] = 0;
      }
    }
  }
  int res = 0;
  for (int s = 0; s <= All; ++s) {
    for (int a = 0; a < 2; ++a) {
      for (int b = 0; b < 2; ++b) {
        ADD(res, f[nwt][s][a][b]);
      }
    }
  }
  printf("%d\n", (res % P + P) % P);
  return 0;
}
