#include <bits/stdc++.h>
using namespace std;
long long h, w;
char c[255][255];
long long dp[2][15][1 << 15][2][2];
int main(void) {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> h >> w;
  for (long long(y) = (1); (y) <= (h); (y)++) {
    for (long long(x) = (1); (x) <= (w); (x)++) {
      cin >> c[x][y];
    }
  }
  if (h > w) {
    for (long long(y) = (1); (y) <= (h); (y)++)
      for (long long(x) = (1); (x) <= (h); (x)++) {
        if (x > y) swap(c[x][y], c[y][x]);
      }
    swap(h, w);
  }
  long long H = 1 << h;
  dp[0][0][0][0][0] = 1;
  for (long long(i) = (0); (i) <= (w - 1); (i)++) {
    for (long long(j) = (0); (j) <= (h - 1); (j)++) {
      long long ni = i + (j + 1) / h, nj = (j + 1) % h;
      for (long long(k) = (0); (k) <= (H - 1); (k)++)
        for (long long(l) = (0); (l) <= (1); (l)++)
          for (long long(m) = (0); (m) <= (1); (m)++)
            dp[ni % 2][nj][k][l][m] = 0;
      for (long long(k) = (0); (k) <= (H - 1); (k)++) {
        for (long long(l) = (0); (l) <= (1); (l)++) {
          for (long long(m) = (0); (m) <= (1); (m)++) {
            if (c[i + 1][j + 1] == 'x') {
              (dp[(ni % 2)][nj][k & ~(1 << j)][0][m] +=
               dp[i % 2][j][k][l][m]) %= 1000000007;
              continue;
            }
            if (j < h - 1)
              (dp[(ni % 2)][nj][k | (1 << j)][1][m] += dp[i % 2][j][k][l][m]) %=
                  1000000007;
            else
              (dp[(ni % 2)][nj][k | (1 << j)][0][m] += dp[i % 2][j][k][l][m]) %=
                  1000000007;
            long long nl = l;
            if (j == h - 1) nl = 0;
            if ((k & (1 << j)) == 0 && l == 0) {
              if (m == 0)
                (dp[(ni % 2)][nj][k][nl][1] += dp[i % 2][j][k][l][m]) %=
                    1000000007;
            } else
              (dp[(ni % 2)][nj][k][nl][m] += dp[i % 2][j][k][l][m]) %=
                  1000000007;
          }
        }
      }
    }
  }
  long long ans = 0;
  for (long long(k) = (0); (k) <= (H - 1); (k)++)
    for (long long(m) = (0); (m) <= (1); (m)++)
      ans += dp[w % 2][0][k][0][m], ans %= 1000000007;
  cout << ans << endl;
  return 0;
}
