#include <bits/stdc++.h>
using namespace std;
int n;
int m;
vector<vector<vector<vector<vector<int> > > > > dp;
char room[252][252];
int cnt[252][252];
char tmp[252][252];
void rotate() {
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      tmp[j][n - i - 1] = room[i][j];
    }
  }
  swap(n, m);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      room[i][j] = tmp[i][j];
    }
  }
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    scanf("%s", room[i]);
  }
  if (n < m) {
    for (int i = 0; i < n; i++) {
      for (int j = i; j < m; j++) {
        swap(room[i][j], room[j][i]);
      }
    }
    swap(n, m);
  }
  rotate();
  rotate();
  for (int i = 0; i < n; i++) {
    for (int j = m - 1; j >= 0; j--) {
      if (room[i][j] != '.') continue;
      cnt[i][j] = 1;
      if (j + 1 < m && room[i][j + 1] == '.') {
        cnt[i][j] += cnt[i][j + 1];
      }
    }
  }
  dp.assign(n,
            vector<vector<vector<vector<int> > > >(
                m, vector<vector<vector<int> > >(
                       (1 << m), vector<vector<int> >(2, vector<int>(2, 0)))));
  dp[n - 1][m - 1][0][0][0] = 1;
  int ans = 0;
  for (int i = n - 1; i >= 0; i--) {
    for (int j = m - 1; j >= 0; j--) {
      for (int k = 0; k < (1 << m); k++) {
        for (int kk = 0; kk < 2; kk++) {
          for (int k2 = 0; k2 < 2; k2++) {
            if (dp[i][j][k][kk][k2] == 0) continue;
            if (room[i][j] != '.') {
              int go = (k & (~((1 << j))));
              int *nex;
              if (i == 0 && j == 0) {
                nex = &ans;
              } else {
                if (i && j == 0) {
                  nex = &dp[i - 1][m - 1][go][kk][0];
                } else {
                  nex = &dp[i][j - 1][go][kk][0];
                }
              }
              *nex += dp[i][j][k][kk][k2];
              if (*nex >= 1000000007) *nex -= 1000000007;
              continue;
            }
            bool pro = (k2 > 0) || ((k >> j) & 1);
            if (kk == 0 && pro == false) {
              int *nex;
              int go = k;
              if (i == 0 && j == 0) {
                nex = &ans;
              } else {
                if (i && j == 0) {
                  nex = &dp[i - 1][m - 1][go][true][0];
                } else {
                  nex = &dp[i][j - 1][go][true][k2];
                }
              }
              *nex += dp[i][j][k][kk][k2];
              if (*nex >= 1000000007) *nex -= 1000000007;
            }
            if (pro) {
              int go = k;
              int *nex;
              if (i == 0 && j == 0) {
                nex = &ans;
              } else {
                if (j == 0) {
                  nex = &dp[i - 1][m - 1][go][kk][0];
                } else {
                  nex = &dp[i][j - 1][go][kk][k2];
                }
              }
              *nex += dp[i][j][k][kk][k2];
              if (*nex >= 1000000007) *nex -= 1000000007;
            }
            int go = k | (1 << j);
            int *nex;
            if (i == 0 && j == 0) {
              nex = &ans;
            } else {
              if (j == 0) {
                nex = &dp[i - 1][m - 1][go][kk][0];
              } else {
                nex = &dp[i][j - 1][go][kk][true];
              }
            }
            *nex += dp[i][j][k][kk][k2];
            if (*nex >= 1000000007) *nex -= 1000000007;
          }
        }
      }
    }
  }
  cout << ans << endl;
  return 0;
}
