#include <bits/stdc++.h>
const long long MAXN = 3010;
const long long mod = 1e9 + 7;
char a[MAXN][MAXN];
long long n, m, ans, f[MAXN][MAXN];
inline long long solve(long long x1, long long y1, long long x2, long long y2) {
  if (a[x1][y1] == '#') return 0;
  std::memset(f, 0, sizeof(f));
  f[x1][y1] = 1;
  for (register long long i = 1; i <= n; i++) {
    for (register long long j = 1; j <= m; j++) {
      if (a[i][j] == '#') continue;
      f[i][j] = (f[i][j] + f[i - 1][j] + f[i][j - 1]) % mod;
    }
  }
  return f[x2][y2];
}
signed main() {
  std::scanf("%lld %lld", &n, &m);
  for (register long long i = 1; i <= n; i++) scanf("%s", a[i] + 1);
  ans = ((solve(1, 2, n - 1, m) * solve(2, 1, n, m - 1) % mod -
          solve(1, 2, n, m - 1) * solve(2, 1, n - 1, m) % mod + mod) %
         mod);
  std::printf("%lld", ans);
  return 0;
}
