Polycarp owns a shop in the capital of Berland. Recently the criminal activity in the capital increased, so Polycarp is thinking about establishing some better security in the storehouse of his shop.

The storehouse can be represented as a matrix with n rows and m columns. Each element of the matrix is either . (an empty space) or x (a wall).

Polycarp wants to hire some guards (possibly zero) to watch for the storehouse. Each guard will be in some cell of matrix and will protect every cell to the right of his own cell and every cell to the bottom of his own cell, until the nearest wall. More formally, if the guard is standing in the cell (x0, y0), then he protects cell (x1, y1) if all these conditions are met:

  * (x1, y1) is an empty cell; 
  * either x0 = x1 and y0 ≤ y1, or x0 ≤ x1 and y0 = y1; 
  * there are no walls between cells (x0, y0) and (x1, y1). There can be a guard between these cells, guards can look through each other.



Guards can be placed only in empty cells (and can protect only empty cells). The plan of placing the guards is some set of cells where guards will be placed (of course, two plans are different if there exists at least one cell that is included in the first plan, but not included in the second plan, or vice versa). Polycarp calls a plan suitable if there is not more than one empty cell that is not protected.

Polycarp wants to know the number of suitable plans. Since it can be very large, you have to output it modulo 109 + 7.

Input

The first line contains two numbers n and m — the length and the width of the storehouse (1 ≤ n, m ≤ 250, 1 ≤ nm ≤ 250).

Then n lines follow, ith line contains a string consisting of m characters — ith row of the matrix representing the storehouse. Each character is either . or x.

Output

Output the number of suitable plans modulo 109 + 7.

Examples

Input

1 3
.x.


Output

3


Input

2 2
xx
xx


Output

1


Input

2 2
..
..


Output

10


Input

3 1
x
.
x


Output

2

Note

In the first example you have to put at least one guard, so there are three possible arrangements: one guard in the cell (1, 1), one guard in the cell (1, 3), and two guards in both these cells.
#include <bits/stdc++.h>
using namespace std;
const long double pi = acos(-1);
const int arr = 4 * 1e5 + 100;
const long long md = 1e9 + 7;
const long long base = 31;
const int AaA = 'a' - 'A';
long double eps = 1e-7;
long long a[500][500], b[500][500];
string st[500];
long long dp[17][2][40000][3][3];
signed main() {
  long long n, m;
  cin >> n >> m;
  for (long long i = 1; i <= n; i++) {
    cin >> st[i];
    for (long long j = 1; j <= m; j++) a[i][j] = (st[i][j - 1] == 'x');
  }
  if (n > m) {
    for (long long i = 1; i <= n; i++)
      for (long long j = 1; j <= m; j++) b[j][i] = a[i][j];
    swap(n, m);
    for (long long i = 1; i <= n; i++)
      for (long long j = 1; j <= m; j++) a[i][j] = b[i][j];
  }
  dp[1][1][0][0][0] = 1;
  long long mxmask = (1 << n);
  for (long long j = 1; j <= m; j++) {
    for (long long i = 1; i < n; i++)
      for (long long mask = 0; mask < mxmask; mask++)
        for (long long up = 0; up <= 1; up++) {
          if (dp[i][j % 2][mask][0][up] == 0 && dp[i][j % 2][mask][1][up] == 0)
            continue;
          if (a[i][j]) {
            long long nmask = mask / 2;
            dp[i + 1][j % 2][nmask][0][0] += dp[i][j % 2][mask][0][up];
            dp[i + 1][j % 2][nmask][1][0] += dp[i][j % 2][mask][1][up];
            dp[i + 1][j % 2][nmask][0][0] %= md;
            dp[i + 1][j % 2][nmask][1][0] %= md;
          } else if (mask % 2) {
            long long nmask = mask / 2 + (1 << (n - 1));
            dp[i + 1][j % 2][nmask][0][up] += dp[i][j % 2][mask][0][up] % md;
            dp[i + 1][j % 2][nmask][1][up] += dp[i][j % 2][mask][1][up] % md;
            dp[i + 1][j % 2][nmask][0][1] += dp[i][j % 2][mask][0][up] % md;
            dp[i + 1][j % 2][nmask][1][1] += dp[i][j % 2][mask][1][up] % md;
            dp[i + 1][j % 2][nmask][0][up] %= md;
            dp[i + 1][j % 2][nmask][1][up] %= md;
            dp[i + 1][j % 2][nmask][0][1] %= md;
            dp[i + 1][j % 2][nmask][1][1] %= md;
          } else if (up) {
            long long nmask = mask / 2;
            dp[i + 1][j % 2][nmask][0][up] += dp[i][j % 2][mask][0][up] % md;
            dp[i + 1][j % 2][nmask][1][up] += dp[i][j % 2][mask][1][up] % md;
            dp[i + 1][j % 2][nmask][0][up] %= md;
            dp[i + 1][j % 2][nmask][1][up] %= md;
            nmask = mask / 2 + (1 << (n - 1));
            dp[i + 1][j % 2][nmask][0][up] += dp[i][j % 2][mask][0][up] % md;
            dp[i + 1][j % 2][nmask][1][up] += dp[i][j % 2][mask][1][up] % md;
            dp[i + 1][j % 2][nmask][0][up] %= md;
            dp[i + 1][j % 2][nmask][1][up] %= md;
          } else {
            long long nmask = mask / 2 + (1 << (n - 1));
            dp[i + 1][j % 2][nmask][0][1] += dp[i][j % 2][mask][0][0];
            dp[i + 1][j % 2][nmask][1][1] += dp[i][j % 2][mask][1][0];
            dp[i + 1][j % 2][nmask][0][1] %= md;
            dp[i + 1][j % 2][nmask][1][1] %= md;
            nmask = mask / 2;
            dp[i + 1][j % 2][nmask][1][0] += dp[i][j % 2][mask][0][0];
            dp[i + 1][j % 2][nmask][1][0] %= md;
          }
        }
    for (long long mask = 0; mask < mxmask; mask++)
      for (long long up = 0; up <= 1; up++) {
        if (dp[n][j % 2][mask][0][up] == 0 && dp[n][j % 2][mask][1][up] == 0)
          continue;
        if (a[n][j]) {
          long long nmask = mask / 2;
          dp[1][(j + 1) % 2][nmask][0][0] += dp[n][j % 2][mask][0][up];
          dp[1][(j + 1) % 2][nmask][0][0] %= md;
          dp[1][(j + 1) % 2][nmask][1][0] += dp[n][j % 2][mask][1][up];
          dp[1][(j + 1) % 2][nmask][1][0] %= md;
        } else if (mask % 2) {
          long long nmask = mask / 2 + (1 << (n - 1));
          dp[1][(j + 1) % 2][nmask][0][0] += 2 * dp[n][j % 2][mask][0][up] % md;
          dp[1][(j + 1) % 2][nmask][1][0] += 2 * dp[n][j % 2][mask][1][up] % md;
          dp[1][(j + 1) % 2][nmask][0][0] %= md;
          dp[1][(j + 1) % 2][nmask][1][0] %= md;
        } else if (up) {
          long long nmask = mask / 2;
          dp[1][(j + 1) % 2][nmask][0][0] += dp[n][j % 2][mask][0][up];
          dp[1][(j + 1) % 2][nmask][1][0] += dp[n][j % 2][mask][1][up];
          dp[1][(j + 1) % 2][nmask][0][0] %= md;
          dp[1][(j + 1) % 2][nmask][1][0] %= md;
          nmask = mask / 2 + (1 << (n - 1));
          dp[1][(j + 1) % 2][nmask][0][0] += dp[n][j % 2][mask][0][up];
          dp[1][(j + 1) % 2][nmask][1][0] += dp[n][j % 2][mask][1][up];
          dp[1][(j + 1) % 2][nmask][0][0] %= md;
          dp[1][(j + 1) % 2][nmask][1][0] %= md;
        } else {
          long long nmask = mask / 2 + (1 << (n - 1));
          dp[1][(j + 1) % 2][nmask][0][0] += dp[n][j % 2][mask][0][up];
          dp[1][(j + 1) % 2][nmask][1][0] += dp[n][j % 2][mask][1][up];
          dp[1][(j + 1) % 2][nmask][0][0] %= md;
          dp[1][(j + 1) % 2][nmask][1][0] %= md;
          nmask = mask / 2;
          dp[1][(j + 1) % 2][nmask][1][0] += dp[n][j % 2][mask][0][up];
          dp[1][(j + 1) % 2][nmask][1][0] %= md;
        }
      }
    for (long long i = 1; i <= n; i++)
      for (long long mask = 0; mask < mxmask; mask++)
        for (long long up = 0; up <= 1; up++) {
          dp[i][j % 2][mask][0][up] = 0;
          dp[i][j % 2][mask][1][up] = 0;
        }
  }
  long long ans = 0;
  for (long long mask = 0; mask < mxmask; mask++) {
    ans +=
        (dp[1][(m + 1) % 2][mask][0][0] + dp[1][(m + 1) % 2][mask][1][0]) % md;
    ans %= md;
  }
  cout << ans;
}
