#include <bits/stdc++.h>
using namespace std;
namespace Tzh {
const long long p = 1e9 + 7, maxn = 3010;
long long g[maxn][maxn], dp[maxn][maxn], n, m, ans1, ans2;
char s[maxn];
void work() {
  scanf("%lld%lld", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%s", s + 1);
    for (int j = 1; j <= m; j++) g[i][j] = s[j] == '.';
  }
  memset(dp, 0, sizeof(dp));
  dp[1][2] = g[1][2];
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (!g[i][j] || dp[i][j]) continue;
      dp[i][j] = (dp[i - 1][j] + dp[i][j - 1]) % p;
    }
  }
  ans1 = dp[n - 1][m], ans2 = dp[n][m - 1];
  memset(dp, 0, sizeof(dp));
  dp[2][1] = g[2][1];
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (!g[i][j] || dp[i][j]) continue;
      dp[i][j] = (dp[i - 1][j] + dp[i][j - 1]) % p;
    }
  }
  printf("%lld", (dp[n][m - 1] * ans1 % p + p - ans2 * dp[n - 1][m] % p) % p);
  return;
}
}  // namespace Tzh
int main() {
  Tzh::work();
  return 0;
}
