#include <bits/stdc++.h>
using namespace std;
char g[251][251], tmp[251][251];
int n, m, dp[251][1 << 16][2][2];
int calc(int r, int c, int P, bool a, bool b) {
  if (c == m) return calc(r + 1, 0, P, a, 0);
  if (r == n) return 1;
  int &ret = dp[r * m + c][P][a][b];
  if (ret != -1) return ret;
  ret = 0;
  if (g[r][c] == '.') {
    if (b || (1 << c) & P) ret += calc(r, c + 1, P, a, b);
    ret += calc(r, c + 1, P | (1 << c), a, 1);
    ret %= 1000000007;
    if (!a && !b && !(1 << c & P)) ret += calc(r, c + 1, P, 1, b);
    ret %= 1000000007;
  } else
    ret += calc(r, c + 1, P & ~(1 << c), a, 0);
  ret %= 1000000007;
  return ret;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) scanf("%s", g[i]);
  if (n < m) {
    for (int i = 0; i < n; i++)
      for (int j = 0; j < m; j++) tmp[j][i] = g[i][j];
    swap(n, m);
    memcpy(g, tmp, sizeof(tmp));
  }
  memset(dp, -1, sizeof(dp));
  printf("%d\n", calc(0, 0, 0, 0, 0));
  return 0;
}
