#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e3 + 10;
const int mod = 1e9 + 7;
char s[maxn][maxn];
int dp[maxn][maxn];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%s", s[i] + 1);
  memset(dp, 0, sizeof(dp));
  if (s[1][2] == '.') dp[1][2] = 1;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      if (s[i][j] == '.') {
        (dp[i][j] += dp[i - 1][j]) %= mod;
        (dp[i][j] += dp[i][j - 1]) %= mod;
      }
  long long a = dp[n - 1][m], c = dp[n][m - 1];
  memset(dp, 0, sizeof(dp));
  if (s[2][1] == '.') dp[2][1] = 1;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      if (s[i][j] == '.') {
        (dp[i][j] += dp[i - 1][j]) %= mod;
        (dp[i][j] += dp[i][j - 1]) %= mod;
      }
  long long b = dp[n][m - 1], d = dp[n - 1][m];
  long long ans = a * b % mod - c * d % mod;
  (ans += mod) %= mod;
  cout << ans << '\n';
  return 0;
}
