#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + (ch ^ 48);
    ch = getchar();
  }
  return x * f;
}
const int N = 3010, mod = 1000000007;
int n, m, dp[N][N], ans;
char s[N][N];
inline int sol(int x_csyakioi_1, int y_csyakioi_1, int x_csyakioi_2,
               int y_csyakioi_2) {
  memset(dp, 0, sizeof(dp));
  dp[x_csyakioi_1][y_csyakioi_1] = (int)(s[x_csyakioi_1][y_csyakioi_1] == '.');
  for (int i = x_csyakioi_1; i <= x_csyakioi_2; ++i) {
    for (int j = y_csyakioi_1; j <= y_csyakioi_2; ++j) {
      if ((i == x_csyakioi_1 && j == y_csyakioi_1) || s[i][j] == '#') continue;
      dp[i][j] = (dp[i - 1][j] + dp[i][j - 1]) % mod;
    }
  }
  return dp[x_csyakioi_2][y_csyakioi_2];
}
int main() {
  n = read();
  m = read();
  for (int i = 1; i <= n; ++i) scanf("%s", s[i] + 1);
  printf("%d\n", (1ll * sol(1, 2, n - 1, m) * sol(2, 1, n, m - 1) % mod -
                  1ll * sol(1, 2, n, m - 1) * sol(2, 1, n - 1, m) % mod + mod) %
                     mod);
  return 0;
}
