#include <bits/stdc++.h>
using namespace std;
bool liber[260][260];
long long dp[2][17][1 << 16][2];
void mk_dp(int lin, int col, int mask, int sec);
int main() {
  int n, m;
  bool inv(0);
  cin >> n >> m;
  if (n < m) inv = 1;
  for (int i(1); i <= n; i++) {
    for (int j(1); j <= m; j++) {
      char c;
      cin >> c;
      if (inv)
        liber[j][i] = (c == '.');
      else
        liber[i][j] = (c == '.');
    }
  }
  if (inv) swap(n, m);
  dp[0][m][0][0] = 1;
  for (int i(1); i <= n; i++) {
    for (int mask(0); mask < (1 << (m + 1)); mask += 2)
      for (int q(0); q <= 1; q++)
        dp[i & 1][0][mask][q] =
            (dp[!(i & 1)][m][mask][q] + dp[!(i & 1)][m][mask ^ 1][q]) %
            1000000007ll;
    for (int j(1); j <= m; j++)
      for (int mask(0); mask < (1 << (m + 1)); mask++)
        mk_dp(i, j, mask, 0), mk_dp(i, j, mask, 1);
  }
  long long ans(0);
  for (int mask(0); mask < (1 << (m + 1)); mask++)
    ans =
        ((ans + dp[n & 1][m][mask][0]) % 1000000007ll + dp[n & 1][m][mask][1]) %
        1000000007ll;
  cout << ans;
  return 0;
}
void mk_dp(int lin, int col, int mask, int sec) {
  dp[lin & 1][col][mask][sec] = 0;
  if (!liber[lin][col]) {
    if ((mask & (1 << col)) || (mask & 1)) return;
    for (int i(0); i < 4; i++)
      dp[lin & 1][col][mask][sec] =
          (dp[lin & 1][col][mask][sec] +
           dp[lin & 1][col - 1]
             [mask ^ ((i & 1) ? (1 << col) : 0) ^ ((i & 2) ? 1 : 0)][sec]) %
          1000000007ll;
  } else {
    if (!(mask & (1 << col))) {
      if (sec == 1 && !(mask & 1))
        dp[lin & 1][col][mask][sec] = dp[lin & 1][col - 1][mask][0];
      if (mask & 1)
        dp[lin & 1][col][mask][sec] =
            (dp[lin & 1][col][mask][sec] + dp[lin & 1][col - 1][mask][sec]) %
            1000000007ll;
      return;
    }
    if (mask & 1) {
      if (mask & (1 << col)) {
        for (int i(0); i < 4; i++)
          dp[lin & 1][col][mask][sec] =
              (dp[lin & 1][col][mask][sec] +
               dp[lin & 1][col - 1]
                 [mask ^ ((i & 1) ? (1 << col) : 0) ^ ((i & 2) ? 1 : 0)][sec]) %
              1000000007ll;
        dp[lin & 1][col][mask][sec] =
            (dp[lin & 1][col][mask][sec] + dp[lin & 1][col - 1][mask][sec]) %
            1000000007ll;
      } else
        dp[lin & 1][col][mask][sec] =
            (dp[lin & 1][col][mask][sec] + dp[lin & 1][col - 1][mask][sec]) %
            1000000007ll;
    } else {
      dp[lin & 1][col][mask][sec] =
          (dp[lin & 1][col][mask][sec] +
           dp[lin & 1][col - 1][mask | (1 << col)][sec]) %
          1000000007ll;
    }
  }
}
