#include <bits/stdc++.h>
using namespace std;
long long pwr(long long base, long long p, long long mod = (1000000007LL)) {
  long long ans = 1;
  while (p) {
    if (p & 1) ans = (ans * base) % mod;
    base = (base * base) % mod;
    p /= 2;
  }
  return ans;
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
int r, c;
char arr[255][255], storage[255][255];
vector<vector<vector<int> > > DP[2][2];
int dp(int mask, int i, int j, int done, int horizontal) {
  if (done > 1) return 0;
  if (j == c) return dp(mask, i + 1, 0, done, 0);
  if (i == r) {
    return 1;
  }
  int &ans = DP[done][horizontal][mask][i][j];
  if (ans != -1) return ans;
  ans = 0;
  if (arr[i][j] == '.') {
    if ((mask >> j) & 1) {
      ans = (ans + 1LL * dp(mask, i, j + 1, done, horizontal)) % (1000000007LL);
      ans = (ans + 1LL * dp(mask, i, j + 1, done, 1)) % (1000000007LL);
    } else {
      ans = (ans +
             1LL * dp(mask, i, j + 1, done + (horizontal == 0), horizontal)) %
            (1000000007LL);
      ans =
          (ans + 1LL * dp(mask | (1 << j), i, j + 1, done, 1)) % (1000000007LL);
    }
  } else {
    ans = (ans +
           1LL * dp(mask & (((1 << c) - 1) ^ (1 << j)), i, j + 1, done, 0)) %
          (1000000007LL);
  }
  return ans;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> r >> c;
  for (int i = 0; i < r; i++) cin >> arr[i];
  if (r < c) {
    for (int i = 0; i < r; i++)
      for (int j = 0; j < c; j++) storage[j][i] = arr[i][j];
    for (int i = 0; i < c; i++)
      for (int j = 0; j < r; j++) arr[i][j] = storage[i][j];
    swap(r, c);
  }
  for (int z1 = 0; z1 < 2; z1++)
    for (int z2 = 0; z2 < 2; z2++) {
      DP[z1][z2].resize((1 << c) + 2);
      for (int i = 0; i <= (1 << c) + 1; i++) {
        DP[z1][z2][i].resize(r);
        for (int j = 0; j < r; j++) DP[z1][z2][i][j].resize(c);
      }
    }
  for (int mask = 0; mask < (1 << c); mask++)
    for (int i = 0; i < r; i++)
      for (int j = 0; j < c; j++)
        DP[0][0][mask][i][j] = DP[0][1][mask][i][j] = DP[1][0][mask][i][j] =
            DP[1][1][mask][i][j] = -1;
  cout << dp(0, 0, 0, 0, 0);
  return 0;
}
