#include <bits/stdc++.h>
using namespace std;
int const N = 255;
int const M = 16;
int const MOD = 1000 * 1000 * 1000 + 7;
int n, m;
int a[N][N];
int c[N][N];
int d[2][(1 << M)][2][3];
void add(int &a, int b) {
  a += b;
  if (a >= MOD) a -= MOD;
}
void swapMat() {
  swap(n, m);
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      c[i][m - 1 - j] = a[j][i];
    }
  }
  for (int i = 0; i < N; ++i)
    for (int j = 0; j < N; ++j) a[i][j] = c[i][j];
}
void fence() {
  for (int i = 0; i < n; ++i) a[i][m] = 1;
  ++m;
}
bool bit(int mask, int id) {
  if ((1 << id) & mask)
    return true;
  else
    return false;
}
void clear(int id) {
  for (int mask = 0; mask < (1 << m); ++mask)
    for (int c1 = 0; c1 < 2; ++c1)
      for (int c2 = 0; c2 < 3; ++c2) d[id][mask][c1][c2] = 0;
}
void build() {
  int id = (m & 1);
  for (int mask = 0; mask < (1 << m); ++mask) {
    int cnt = 0;
    int bad = 0;
    int buf = 0;
    for (int i = 0; i < m; ++i) {
      if (a[0][i]) {
        if (bit(mask, i)) bad = 1;
        cnt += buf;
        buf = 0;
      } else {
        ++buf;
        if (bit(mask, i)) buf = 0;
      }
    }
    if (cnt > 1) bad = 1;
    if (bad) continue;
    d[id][mask][cnt][0] = 1;
  }
}
void solve() {
  cin >> n >> m;
  for (int i = 0; i < n; ++i) {
    string s;
    cin >> s;
    for (int j = 0; j < m; ++j)
      if (s[j] == 'x') a[i][j] = 1;
  }
  if (m > n) {
    swapMat();
  } else {
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < (m + 1) / 2; ++j) swap(a[i][j], a[i][m - 1 - j]);
    }
  }
  fence();
  build();
  for (int i = m; i < n * m; ++i) {
    int cur = (i & 1);
    int nxt = 1 - cur;
    clear(nxt);
    int r = i / m;
    int c = i % m;
    for (int mask = 0; mask < (1 << m); ++mask) {
      int have = (mask & 1);
      for (int cnt = 0; cnt < 2; ++cnt) {
        for (int buf = 0; buf < 3; ++buf) {
          if (d[cur][mask][cnt][buf] == 0) continue;
          for (int take = 0; take < 2; ++take) {
            if (a[r][c]) {
              if (take) continue;
              int ntake = 0;
              int nmask = ((mask >> 1) | (ntake << (m - 1)));
              int ncnt = cnt + buf;
              if (ncnt > 1) continue;
              add(d[nxt][nmask][ncnt][0], d[cur][mask][cnt][buf]);
            } else {
              int ntake = max(take, have);
              int nmask = ((mask >> 1) | (ntake << (m - 1)));
              int ncnt = cnt;
              int nbuf = buf;
              if (take) {
                nbuf = 0;
              } else {
                if (!have) nbuf += 1;
              }
              nbuf = min(nbuf, 2);
              add(d[nxt][nmask][ncnt][nbuf], d[cur][mask][cnt][buf]);
            }
          }
        }
      }
    }
  }
  int ans = 0;
  int id = ((n * m) & 1);
  for (int mask = 0; mask < (1 << m); ++mask) {
    for (int cnt = 0; cnt < 2; ++cnt) {
      add(ans, d[id][mask][cnt][0]);
    }
  }
  cout << ans << endl;
}
int main() {
  solve();
  return 0;
}
