#include <bits/stdc++.h>
using namespace std;
int n, m;
char ch[255][255], tmp[255][255];
int dp[255][1 << 16][2][2];
const int Mod = 1000000007;
void add(int &a, int b) {
  a += b;
  if (a >= Mod) {
    a -= Mod;
  }
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) {
    scanf("%s", ch[i]);
  }
  if (n < m) {
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        tmp[j][i] = ch[i][j];
      }
    }
    swap(n, m);
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        ch[i][j] = tmp[i][j];
      }
    }
  }
  dp[0][0][0][0] = 1;
  int ful = (1 << m) - 1;
  for (int pos = 0; pos < n * m; pos++) {
    int i = pos / m, j = pos % m;
    for (int msk = 0; msk <= ful; msk++) {
      for (int a = 0; a < 2; a++) {
        for (int b = 0; b < 2; b++) {
          if (ch[i][j] == 'x') {
            int nmsk = (msk << 1) & ful;
            add(dp[pos + 1][nmsk][0][b], dp[pos][msk][a][b]);
          } else {
            if ((msk >> (m - 1)) & 1) {
              int nmsk = (msk << 1 | 1) & ful;
              add(dp[pos + 1][nmsk][j == m - 1 ? 0 : a][b], dp[pos][msk][a][b]);
              add(dp[pos + 1][nmsk][j == m - 1 ? 0 : 1][b], dp[pos][msk][a][b]);
            } else {
              int nmsk = (msk << 1 | 1) & ful;
              add(dp[pos + 1][nmsk][j == m - 1 ? 0 : 1][b], dp[pos][msk][a][b]);
              if (a) {
                nmsk = (msk << 1) & ful;
                add(dp[pos + 1][nmsk][j == m - 1 ? 0 : a][b],
                    dp[pos][msk][a][b]);
              } else if (!b) {
                nmsk = (msk << 1) & ful;
                add(dp[pos + 1][nmsk][0][1], dp[pos][msk][a][b]);
              }
            }
          }
        }
      }
    }
  }
  int ans = 0;
  for (int msk = 0; msk <= ful; msk++) {
    for (int b = 0; b < 2; b++) {
      add(ans, dp[n * m][msk][0][b]);
    }
  }
  printf("%d\n", ans);
  return 0;
}
