#include <bits/stdc++.h>
using namespace std;
char grid[250][250];
int colMask[250];
int n, m;
long long res;
int main() {
  scanf("%d %d", &n, &m);
  if (n > m) {
    for (int i = 0; i < n; ++i)
      for (int j = 0; j < m; ++j) scanf(" %c", &grid[j][i]);
    swap(n, m);
  } else {
    for (int i = 0; i < n; ++i)
      for (int j = 0; j < m; ++j) scanf(" %c", &grid[i][j]);
  }
  for (int c = 0; c < m; ++c)
    for (int r = 0; r < n; ++r)
      if (grid[r][c] == 'x') colMask[c] |= (1 << r);
  long long dp[n][m][1 << n][2][2];
  memset(dp, 0, sizeof dp);
  dp[0][0][colMask[0]][0][0] = 1;
  res = 0;
  for (int c = 0; c < m; ++c)
    for (int r = 0; r < n; ++r)
      for (int mask = 0; mask < (1 << n); ++mask)
        for (int pa = 0; pa < 2; ++pa)
          for (int onp = 0; onp < 2; ++onp) {
            if (r == n - 1 && c == m - 1) {
              if (pa || (mask & (1 << r)) || !onp)
                res += dp[r][c][mask][pa][onp];
              if (grid[r][c] == '.') res += dp[r][c][mask][pa][onp];
              res %= 1000000007;
            } else {
              int next_r = (r + 1) % n;
              int next_c = c + (next_r == 0);
              int next_mask = mask;
              if (next_c > c) {
                next_mask &= ~colMask[c];
                next_mask |= colMask[next_c];
              }
              if (grid[r][c] == 'x') {
                dp[next_r][next_c][next_mask][0][onp] +=
                    dp[r][c][mask][pa][onp];
                dp[next_r][next_c][next_mask][0][onp] %= 1000000007;
              } else {
                dp[next_r][next_c][next_mask | (1 << r)][next_c == c][onp] +=
                    dp[r][c][mask][pa][onp];
                dp[next_r][next_c][next_mask | (1 << r)][next_c == c][onp] %=
                    1000000007;
                if ((mask & (1 << r)) || pa || !onp) {
                  dp[next_r][next_c][next_mask][pa && (next_c == c)]
                    [onp || !((mask & (1 << r)) || pa)] +=
                      dp[r][c][mask][pa][onp];
                  dp[next_r][next_c][next_mask][pa && (next_c == c)]
                    [onp || !((mask & (1 << r)) || pa)] %= 1000000007;
                }
              }
            }
          }
  printf("%I64lld\n", res);
  return 0;
}
