#include <bits/stdc++.h>
using namespace std;
int dp[(1LL << 15)][251][2][2];
char grid[255][255];
char aux[255][255];
int n, m;
int solve(int mask, int i, int j, int v, int empty_cell) {
  if (i == n) return 1;
  int idx = i * m + j;
  if (dp[mask][idx][v][empty_cell] != -1) return dp[mask][idx][v][empty_cell];
  int next_i = i, next_j = j + 1;
  int answer = 0;
  if (next_j == m) {
    next_i++, next_j = 0;
  }
  if (grid[i][j] == 'x') {
    int mask_aux = mask;
    if ((mask >> j) & 1) {
      mask_aux = mask ^ (1 << j);
    }
    answer = solve(mask_aux, next_i, next_j, 0, empty_cell);
  } else if (next_i == i) {
    answer = solve(mask | (1 << j), next_i, next_j, 1, empty_cell);
    if (v || ((mask >> j) & 1) || !empty_cell) {
      if (v || ((mask >> j) & 1)) {
        answer += solve(mask, next_i, next_j, v, empty_cell);
      } else {
        answer += solve(mask, next_i, next_j, v, 1);
      }
      if (answer >= 1000000007) answer -= 1000000007;
    }
  } else {
    answer = solve(mask | (1 << j), next_i, next_j, 0, empty_cell);
    if (v || ((mask >> j) & 1) || !empty_cell) {
      if (v || ((mask >> j) & 1)) {
        answer += solve(mask, next_i, next_j, 0, empty_cell);
      } else {
        answer += solve(mask, next_i, next_j, 0, 1);
      }
      if (answer >= 1000000007) answer -= 1000000007;
    }
  }
  return dp[mask][idx][v][empty_cell] = answer;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> m;
  memset(dp, -1, sizeof dp);
  for (int i = 0; i < (int)(n); i++) {
    for (int j = 0; j < (int)(m); j++) {
      cin >> grid[i][j];
    }
  }
  if (n < m) {
    for (int i = 0; i < (int)(n); i++) {
      for (int j = 0; j < (int)(m); j++) {
        aux[j][i] = grid[i][j];
      }
    }
    swap(n, m);
    for (int i = 0; i < (int)(n); i++) {
      for (int j = 0; j < (int)(m); j++) {
        grid[i][j] = aux[i][j];
      }
    }
  }
  cout << solve(0, 0, 0, 0, 0) << '\n';
  return 0;
}
