#include <bits/stdc++.h>
using namespace std;
int read() {
  int s = 0, w = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') w = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9')
    s = (s << 3) + (s << 1) + (ch ^ 48), ch = getchar();
  return s * w;
}
char rech() {
  char ch;
  while ((ch = getchar()) ^ '.' && ch ^ 'x')
    ;
  return ch;
}
char S[260][260];
int n, m, f[32768][2][3], g[32768][2][3], pw[20], ans;
void pls(int& x, const int y) {
  x += y;
  x >= 1000000007 ? x -= 1000000007 : 0;
}
signed main() {
  n = read(), m = read();
  if (n < m)
    for (int i = 1; i <= n; i++)
      for (int j = 1; j <= m; j++) S[j][i] = rech();
  else
    for (int i = 1; i <= n; i++)
      for (int j = 1; j <= m; j++) S[i][j] = rech();
  if (n < m) swap(n, m);
  g[0][0][0] = 1;
  pw[0] = 1;
  for (int i = 1; i <= m; i++) pw[i] = pw[i - 1] << 1;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      memset(f, 0, sizeof(f));
      if (S[i][j] == '.')
        for (int k = 0; k < pw[m]; k++)
          for (int l = 0; l < 2; l++)
            for (int p = 0; p < 2; p++)
              for (int q = 0; q < 2; q++)
                pls(f[k | (l ? pw[j - 1] : 0)][(p | l) & (j != m)]
                     [q + !((k & pw[j - 1]) || l || p)],
                    g[k][p][q]);
      else
        for (int k = 0; k < pw[m]; k++)
          for (int p = 0; p < 2; p++)
            for (int q = 0; q < 2; q++)
              pls(f[k & ((pw[m] - 1) ^ pw[j - 1])][0][q], g[k][p][q]);
      memcpy(g, f, sizeof(g));
    }
  for (int k = 0; k < pw[m]; k++)
    for (int p = 0; p < 2; p++) pls(ans, g[k][0][p]);
  cout << ans;
  return 0;
}
