You've got a table of size n × m. We'll consider the table rows numbered from top to bottom 1 through n, and the columns numbered from left to right 1 through m. Then we'll denote the cell in row x and column y as (x, y).

Initially cell (1, 1) contains two similar turtles. Both turtles want to get to cell (n, m). Some cells of the table have obstacles but it is guaranteed that there aren't any obstacles in the upper left and lower right corner. A turtle (one or the other) can go from cell (x, y) to one of two cells (x + 1, y) and (x, y + 1), as long as the required cell doesn't contain an obstacle. The turtles have had an argument so they don't want to have any chance of meeting each other along the way. Help them find the number of ways in which they can go from cell (1, 1) to cell (n, m).

More formally, find the number of pairs of non-intersecting ways from cell (1, 1) to cell (n, m) modulo 1000000007 (109 + 7). Two ways are called non-intersecting if they have exactly two common points — the starting point and the final point.

Input

The first line contains two integers n, m (2 ≤ n, m ≤ 3000). Each of the following n lines contains m characters describing the table. The empty cells are marked by characters ".", the cells with obstacles are marked by "#".

It is guaranteed that the upper left and the lower right cells are empty.

Output

In a single line print a single integer — the number of pairs of non-intersecting paths from cell (1, 1) to cell (n, m) modulo 1000000007 (109 + 7).

Examples

Input

4 5
.....
.###.
.###.
.....


Output

1


Input

2 3
...
...


Output

1
#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
const int maxn = 3010;
int n, m;
char c[maxn][maxn];
int dp[maxn][maxn];
int f[3][3];
int Get_DP(int qx, int qy, int zx, int zy) {
  memset(dp, 0, sizeof(dp));
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) {
      if (c[i][j] == '#') continue;
      if (i == qx && j == qy) {
        dp[i][j] = 1;
        continue;
      }
      dp[i][j] = (dp[i - 1][j] + dp[i][j - 1]) % mod;
    }
  }
  return dp[zx][zy];
}
int det(int n) {
  int ret = 1;
  for (int i = 1; i <= n; ++i) {
    for (int j = i + 1; j <= n; ++j) {
      while (f[j][i]) {
        long long tmp = f[i][i] / f[j][i];
        for (int k = i; k <= n; ++k)
          f[i][k] = (f[i][k] - tmp * f[j][k] % mod + mod) % mod;
        for (int k = i; k <= n; ++k) swap(f[i][k], f[j][k]);
        ret = -ret;
      }
    }
    if (f[i][i] == 0) return 0;
    ret = 1LL * ret * f[i][i] % mod;
  }
  return (ret % mod + mod) % mod;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) {
      c[i][j] = getchar();
      while (c[i][j] < '!') c[i][j] = getchar();
    }
  }
  f[1][1] = Get_DP(2, 1, n, m - 1);
  f[1][2] = Get_DP(2, 1, n - 1, m);
  f[2][1] = Get_DP(1, 2, n, m - 1);
  f[2][2] = Get_DP(1, 2, n - 1, m);
  printf("%d\n", det(2));
  return 0;
}
