#include <bits/stdc++.h>
using namespace std;
const int modd = 1e9 + 7;
const int maxn = 3e3 + 5;
long long dp[maxn][maxn];
char ma[maxn][maxn];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    getchar();
    for (int j = 1; j <= m; j++) {
      ma[i][j] = getchar();
    }
  }
  if (ma[1][2] == '#' || ma[2][1] == '#') {
    printf("0\n");
    return 0;
  } else {
    if (ma[1][2] != '#') dp[1][2]++;
    for (int i = 1; i <= n; i++) {
      for (int j = 2; j <= m; j++) {
        if (ma[i][j] != '#') {
          dp[i][j] = dp[i][j] + dp[i - 1][j] + dp[i][j - 1] % modd;
        }
      }
    }
    long long ans1 = dp[n - 1][m] % modd, ans2 = dp[n][m - 1] % modd;
    memset(dp, 0, sizeof(dp));
    if (ma[2][1] != '#') dp[2][1]++;
    for (int i = 2; i <= n; i++) {
      for (int j = 1; j <= m; j++) {
        if (ma[i][j] != '#') {
          dp[i][j] = (dp[i][j] + dp[i - 1][j] + dp[i][j - 1]) % modd;
        }
      }
    }
    long long ans3 = dp[n - 1][m] % modd, ans4 = dp[n][m - 1] % modd;
    printf("%lld\n",
           ((ans1 * ans4) % modd - (ans2 * ans3) % modd + modd) % modd);
  }
  return 0;
}
