#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
long long f[3001][3001];
long long dp[3001][3001];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie();
  cout.tie();
  long long n, m;
  cin >> n >> m;
  for (long long i = 0; i < n; i++) {
    string s;
    cin >> s;
    for (long long j = 0; j < m; j++) {
      if (s[j] == '.')
        f[i][j] = 0;
      else
        f[i][j] = 1;
    }
  }
  if (f[1][0] == 0) dp[1][0] = 1;
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < m; j++) {
      if (f[i][j] || i + j <= 1) continue;
      if (i == 0 && j == 0) {
      } else if (i == 0) {
        dp[i][j] = dp[i][j - 1];
      } else if (j == 0) {
        dp[i][j] = dp[i - 1][j];
      } else {
        dp[i][j] = dp[i - 1][j] + dp[i][j - 1];
      }
      dp[i][j] = dp[i][j] % mod;
    }
  }
  long long _a = dp[n - 1][m - 2], _b = dp[n - 2][m - 1];
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < m; j++) {
      dp[i][j] = 0;
    }
  }
  if (f[0][1] == 0) dp[0][1] = 1;
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < m; j++) {
      if (f[i][j] || i + j <= 1) continue;
      if (i == 0 && j == 0) {
      } else if (i == 0) {
        dp[i][j] = dp[i][j - 1];
      } else if (j == 0) {
        dp[i][j] = dp[i - 1][j];
      } else {
        dp[i][j] = dp[i - 1][j] + dp[i][j - 1];
      }
      dp[i][j] = dp[i][j] % mod;
    }
  }
  long long _c = dp[n - 1][m - 2], _d = dp[n - 2][m - 1];
  long long res = ((_a * _d - _b * _c) % mod + mod) % mod;
  cout << res << '\n';
  return 0;
}
