#include <bits/stdc++.h>
using namespace std;
using LL = long long;
const int maxn = 3030;
const LL mod = 1E9 + 7;
int n, m;
char s[maxn][maxn];
LL f[maxn][maxn];
signed main() {
  while (~scanf("%d%d", &n, &m)) {
    for (int i = 1; i <= n; i++) {
      scanf("%s", s[i] + 1);
    }
    memset(f, 0, sizeof(f));
    if (s[1][2] == '#' || s[2][1] == '#') {
      printf("0\n");
      continue;
    }
    LL a, b, c, d;
    f[1][2] = (s[1][2] != '#');
    for (int i = 1; i <= n; i++) {
      for (int j = 2; j <= m; j++) {
        if (s[i][j] == '#') continue;
        f[i][j] += (f[i - 1][j] + f[i][j - 1]) % mod;
        f[i][j] %= mod;
      }
    }
    a = f[n - 1][m], b = f[n][m - 1];
    memset(f, 0, sizeof(f));
    f[2][1] = (s[2][1] != '#');
    for (int i = 2; i <= n; i++) {
      for (int j = 1; j <= m; j++) {
        if (s[i][j] == '#') continue;
        f[i][j] += (f[i - 1][j] + f[i][j - 1]) % mod;
        f[i][j] %= mod;
      }
    }
    c = f[n - 1][m], d = f[n][m - 1];
    LL ret = ((a * d) % mod - (b * c) % mod + mod) % mod;
    printf("%lld\n", ret);
  }
  return 0;
}
