#include <bits/stdc++.h>
const int maxn = 3005;
const int mod = 1000000007;
char a[maxn][maxn];
long long f[maxn][maxn];
int n, m;
void init() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; ++i) scanf("%s", a[i]);
}
long long compute(int sx, int sy, int tx, int ty) {
  memset(f, 0, sizeof(f));
  f[sx][sy] = a[sx][sy] == '.';
  for (int i = sx; i < n; ++i) {
    for (int j = sy; j < m; ++j) {
      if (i == sx && j == sy) continue;
      if (i > 0) (f[i][j] += f[i - 1][j]) %= mod;
      if (j > 0) (f[i][j] += f[i][j - 1]) %= mod;
      if (a[i][j] != '.') f[i][j] = 0;
    }
  }
  return f[tx][ty];
}
void work() {
  long long l = compute(0, 1, n - 2, m - 1) * compute(1, 0, n - 1, m - 2) % mod;
  long long r = compute(0, 1, n - 1, m - 2) * compute(1, 0, n - 2, m - 1) % mod;
  printf("%I64d\n", ((l - r) % mod + mod) % mod);
}
int main() {
  init();
  work();
  return 0;
}
