#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
const int MAXW = 15;
const int MAXDIM = 250;
const int MOD = 1000000007;
int h, w;
char g[MAXDIM][MAXDIM];
char gtmp[MAXDIM][MAXDIM];
int dp[2][1 << MAXW][2][2];
void flip() {
  for (int x = (0); x < (h); ++x)
    for (int y = (0); y < (w); ++y) gtmp[y][x] = g[x][y];
  swap(h, w);
  for (int x = (0); x < (h); ++x)
    for (int y = (0); y < (w); ++y) g[x][y] = gtmp[x][y];
  for (int x = (0); x < (h); ++x) g[x][w] = '\0';
}
void inc(int &a, int b) {
  if ((a += b) >= MOD) a -= MOD;
}
void run() {
  scanf("%d%d", &h, &w);
  for (int x = (0); x < (h); ++x) scanf("%s", g[x]);
  if (h < w) flip();
  int z = 0;
  memset(dp[z], 0, sizeof(dp[z]));
  dp[z][0][0][0] = 1;
  for (int x = (0); x < (h); ++x)
    for (int y = (0); y < (w); ++y) {
      memset(dp[1 - z], 0, sizeof(dp[1 - z]));
      for (int dwnmask = (0); dwnmask < (1 << w); ++dwnmask)
        for (int rgt = (0); rgt < (2); ++rgt)
          for (int empty = (0); empty < (2); ++empty)
            if (dp[z][dwnmask][rgt][empty])
              for (int place = (0); place < (2); ++place) {
                int ndwnmask = dwnmask, nrgt = rgt, nempty = empty;
                if (g[x][y] == 'x') {
                  if (place == 1)
                    continue;
                  else
                    ndwnmask &= ~(1 << y), nrgt = 0;
                } else {
                  if (place == 1)
                    ndwnmask |= 1 << y, nrgt = 1;
                  else if (nrgt == 0 && ((ndwnmask >> y) & 1) == 0)
                    if (nempty == 1)
                      continue;
                    else
                      ++nempty;
                }
                if (y == w - 1) nrgt = 0;
                inc(dp[1 - z][ndwnmask][nrgt][nempty],
                    dp[z][dwnmask][rgt][empty]);
              }
      z = 1 - z;
    }
  int ret = 0;
  for (int dwnmask = (0); dwnmask < (1 << w); ++dwnmask)
    for (int rgt = (0); rgt < (2); ++rgt)
      for (int empty = (0); empty < (2); ++empty)
        if (dp[z][dwnmask][rgt][empty]) inc(ret, dp[z][dwnmask][rgt][empty]);
  printf("%d\n", ret);
}
int main() {
  run();
  return 0;
}
