#include <bits/stdc++.h>
using namespace std;
long long n, m, aa[2][2], f[3009][3009], mod = 1e9 + 7;
char s[3009][3009];
void calc(long long a, long long b, long long c, long long d, long long qwq) {
  memset(f, 0, sizeof(f));
  for (long long i = a; i <= c; i += 1)
    for (long long j = b; j <= d; j += 1)
      if (s[i][j] == '.') {
        if (i == a && j == b)
          f[i][j] = 1;
        else
          f[i][j] = (f[i - 1][j] + f[i][j - 1]) % mod;
      }
  aa[qwq][0] = f[c - 1][d];
  aa[qwq][1] = f[c][d - 1];
}
int main() {
  scanf("%lld%lld", &n, &m);
  for (long long i = 1; i <= n; i += 1) scanf("%s", s[i] + 1);
  calc(1, 2, n, m, 0), calc(2, 1, n, m, 1);
  cout << (aa[0][0] * aa[1][1] % mod - aa[0][1] * aa[1][0] % mod + mod) % mod;
  return 0;
}
