#include <bits/stdc++.h>
using namespace std;
const int maxn = 255, maxb = 15;
int N, M;
long long dp[maxn][1 << maxb][2][2];
char arr[maxn][maxn], tmp[maxn][maxn];
inline int gi(int r, int c) { return r * M + c; }
inline void rotate() {
  for (int i = 0; i < M; i++)
    for (int k = 0; k < N; k++) tmp[i][k] = arr[k][M - i - 1];
  swap(N, M);
  for (int i = 0; i < N; i++)
    for (int k = 0; k < M; k++) arr[i][k] = tmp[i][k];
}
inline void flip() {
  for (int i = 0; i < N; i++)
    for (int k = 0; k < M; k++) tmp[i][k] = arr[N - i - 1][k];
  for (int i = 0; i < N; i++)
    for (int k = 0; k < M; k++) arr[i][k] = tmp[i][k];
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> N >> M;
  for (int i = 0; i < N; i++)
    for (int k = 0; k < M; k++) cin >> arr[i][k];
  if (M > N) {
    rotate();
    flip();
  }
  if (arr[0][0] == 'x') {
    dp[0][1][0][0] = 1;
  } else {
    dp[0][0][0][1] = 1;
    dp[0][1][1][0] = 1;
  }
  for (int i = 0; i < N; i++) {
    for (int k = 0; k < M - 1; k++) {
      int idx = gi(i, k), nxt = gi(i, k + 1);
      for (int msk = 0; msk < (1 << M); msk++) {
        for (int lft = 0; lft < 2; lft++) {
          for (int used = 0; used < 2; used++) {
            if (!dp[idx][msk][lft][used]) continue;
            if (arr[i][k + 1] == 'x')
              dp[nxt][msk | (1 << (k + 1))][0][used] =
                  (dp[nxt][msk | (1 << (k + 1))][0][used] +
                   dp[idx][msk][lft][used]) %
                  1000000007;
            else if ((msk & (1 << (k + 1))) || lft) {
              dp[nxt][msk][lft][used] =
                  (dp[nxt][msk][lft][used] + dp[idx][msk][lft][used]) %
                  1000000007;
              dp[nxt][msk | (1 << (k + 1))][1][used] =
                  (dp[nxt][msk | (1 << (k + 1))][1][used] +
                   dp[idx][msk][lft][used]) %
                  1000000007;
            } else {
              dp[nxt][msk | (1 << (k + 1))][1][used] =
                  (dp[nxt][msk | (1 << (k + 1))][1][used] +
                   dp[idx][msk][lft][used]) %
                  1000000007;
              if (used == 0)
                dp[nxt][msk][lft][1] =
                    (dp[nxt][msk][lft][1] + dp[idx][msk][lft][used]) %
                    1000000007;
            }
          }
        }
      }
    }
    if (i == N - 1) break;
    for (int m = 0; m < (1 << M); m++) {
      int msk = m;
      for (int k = 0; k < M; k++)
        if (arr[i][k] == 'x' && (msk & (1 << k))) msk ^= (1 << k);
      int idx = gi(i, M - 1), nxt = gi(i + 1, 0);
      for (int lft = 0; lft < 2; lft++) {
        for (int used = 0; used < 2; used++) {
          if (!dp[idx][m][lft][used]) continue;
          if (arr[i + 1][0] == 'x')
            dp[nxt][msk | 1][0][used] =
                (dp[nxt][msk | 1][0][used] + dp[idx][m][lft][used]) %
                1000000007;
          else if (msk & 1) {
            dp[nxt][msk][0][used] =
                (dp[nxt][msk][0][used] + dp[idx][m][lft][used]) % 1000000007;
            dp[nxt][msk | 1][1][used] =
                (dp[nxt][msk | 1][1][used] + dp[idx][m][lft][used]) %
                1000000007;
          } else {
            dp[nxt][msk | 1][1][used] =
                (dp[nxt][msk | 1][1][used] + dp[idx][m][lft][used]) %
                1000000007;
            if (used == 0)
              dp[nxt][msk][0][1] =
                  (dp[nxt][msk][0][1] + dp[idx][m][lft][used]) % 1000000007;
          }
        }
      }
    }
  }
  long long res = 0;
  for (int msk = 0; msk < (1 << M); msk++)
    for (int lft = 0; lft < 2; lft++)
      for (int used = 0; used < 2; used++)
        res = (res + dp[gi(N - 1, M - 1)][msk][lft][used]) % 1000000007;
  cout << res << '\n';
}
