#include <bits/stdc++.h>
using namespace std;
const int N = 257;
char mat[N][N];
int memo[N][(1 << 16) + 7][2][2];
int n, m;
template <typename T, int bits = 30>
struct bitwise {
  T val;
  bitwise(T x = 0) : val(x) {}
  bitwise operator<<(bitwise x) { return val << x.val; }
  bitwise operator>>(bitwise x) { return val >> x.val; }
  bitwise operator~() { return ~val; }
  bitwise operator^(bitwise x) { return val ^ x.val; }
  bitwise operator&(bitwise x) { return val & x.val; }
  bitwise operator|(bitwise x) { return val | x.val; }
  bitwise operator*(bitwise x) { return val * x.val; }
  bitwise operator-(bitwise x) { return val - x.val; }
  bitwise operator+(bitwise x) { return val + x.val; }
  bitwise operator/(bitwise x) { return val / x.val; }
  int operator[](int p) { return (val >> p) & 1; }
  bitwise toggle(int p) {
    val ^= (T(1) << p);
    return (*this);
  }
  bitwise set(int p) {
    val |= (T(1) << p);
    return (*this);
  }
  bitwise unset(int p) {
    if ((*this)[p]) toggle(p);
    return (*this);
  }
  int count() { return __builtin_popcountll(val); }
  static bitwise ones(int x) { return (bitwise(1) << x) - 1; }
  bitwise substr(int l, int r) { return (val >> l) & ones(r - l + 1); }
  bool superset(bitwise x) { return ((*this) & x) == x; }
  bool subset(bitwise x) { return ((*this) | x) == x; }
  bitwise copy() { return bitwise((*this)()); }
  T operator()() { return val; }
  friend ostream& operator<<(ostream& out, bitwise val) {
    out << bitset<bits>(val.val);
  }
};
using bit = bitwise<int, 20>;
void trans() {
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; ++j) {
      if (j > i) swap(mat[i][j], mat[j][i]);
    }
  }
  swap(n, m);
}
int solve(int pos, bit bs, int ok, int bad) {
  if (bad > 1) return 0;
  if (pos == n * m) return 1;
  int& st = memo[pos][bs()][ok][bad];
  if (st == -1) {
    int i = pos / m;
    int j = pos % m;
    if (mat[i][j] == 'x') {
      st = solve(pos + 1, bs.copy().unset(j), 0, bad);
    } else {
      st = solve(pos + 1, bs.copy().set(j), true and (j + 1 < m), bad);
      st += solve(pos + 1, bs, ok and (j + 1 < m), bad + (!ok && !bs[j]));
      st %= (int)1e9 + 7;
    }
  }
  return st;
}
int main() {
  memset(memo, -1, sizeof memo);
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> mat[i][j];
    }
  }
  if (n < m) trans();
  cout << solve(0, 0, 0, 0) << '\n';
}
