#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int MAXN = 3005;
int n, m;
char g[MAXN][MAXN];
long long f[MAXN][MAXN];
long long cal(int x1, int y1, int x2, int y2) {
  memset(f, 0, sizeof(f));
  if (g[x1][y1] == '#') return 0;
  f[x1][y1] = 1;
  for (int i = x1; i <= x2; i++) {
    for (int j = y1; j <= y2; j++) {
      if (g[i][j] == '#') continue;
      f[i][j] += (f[i - 1][j] + f[i][j - 1]) % mod;
      f[i][j] %= mod;
    }
  }
  return f[x2][y2];
}
long long ans;
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    scanf("%s", g[i] + 1);
  }
  ans = (cal(2, 1, n, m - 1) * cal(1, 2, n - 1, m)) % mod -
        (cal(2, 1, n - 1, m) * cal(1, 2, n, m - 1)) % mod;
  ans = (ans + mod) % mod;
  cout << ans << endl;
  return 0;
}
