#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int maxn = 3010;
char s[maxn];
long long dp[maxn][maxn];
int n, m, a[maxn][maxn];
void Init() {
  scanf("%d%d", &n, &m);
  for (register int i = 1; i <= n; i++) {
    scanf("%s", s);
    for (register int j = 1; j <= m; j++)
      if (s[j - 1] == '#') a[i][j] = 1;
  }
}
int main() {
  Init();
  if (a[1][2] == 1 || a[2][1] == 1) return 0 * puts("0");
  dp[1][2] = 1;
  for (register int i = 1; i <= n; i++)
    for (register int j = 1; j <= m; j++)
      if (!a[i][j]) dp[i][j] = (dp[i][j] + dp[i - 1][j] + dp[i][j - 1]) % mod;
  long long tmp1 = dp[n - 1][m], tmp2 = dp[n][m - 1];
  memset(dp, 0, sizeof(dp));
  dp[2][1] = 1;
  for (register int i = 1; i <= n; i++)
    for (register int j = 1; j <= m; j++)
      if (!a[i][j]) dp[i][j] = (dp[i][j] + dp[i - 1][j] + dp[i][j - 1]) % mod;
  long long tmp3 = dp[n - 1][m], tmp4 = dp[n][m - 1];
  long long ans = (tmp1 * tmp4 - tmp2 * tmp3) % mod;
  ans += mod;
  ans %= mod;
  cout << ans << endl;
  return 0;
}
