#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:100000000000,100000000000")
using namespace std;
const long long inf = 1e18 + 7;
const long long mod = 1e9 + 7;
const double eps = 1e-12;
const double PI = 2 * acos(0.0);
const double E = 2.71828;
int n, m;
char s[3005][3005];
long long f[3005][3005];
long long cnt(int x, int y, int x1, int y1) {
  memset(f, 0, sizeof f);
  if (s[x][y] == '.') f[x][y] = 1;
  for (int i = x; i <= x1; i++)
    for (int j = y; j <= y1; j++)
      if (f[i][j]) {
        if (s[i + 1][j] == '.') f[i + 1][j] += f[i][j];
        if (s[i][j + 1] == '.') f[i][j + 1] += f[i][j];
        f[i + 1][j] %= mod;
        f[i][j + 1] %= mod;
      }
  return f[x1][y1];
}
int main(void) {
  scanf("%d%d", &n, &m);
  gets(s[0]);
  for (long long(i) = 0; (i) < (long long)(n); (i)++) gets(s[i]);
  long long ans = cnt(0, 1, n - 2, m - 1) * cnt(1, 0, n - 1, m - 2) -
                  cnt(0, 1, n - 1, m - 2) * cnt(1, 0, n - 2, m - 1);
  ans %= mod;
  if (ans < 0) ans += mod;
  cout << ans << endl;
  return 0;
}
