#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const int maxn = 100005;
inline int read() {
  int res, ok = 1;
  char ch;
  for (ch = getchar(); ch < '0' || ch > '9'; ch = getchar())
    if (ch == '-') ok = -1;
  res = ch - '0';
  for (ch = getchar(); ch >= '0' && ch <= '9'; ch = getchar())
    res = res * 10 + ch - '0';
  return res * ok;
}
int n, m;
char s[3005][3005];
long long f[3005][3005], ans;
inline long long work(int x1, int y1, int x2, int y2) {
  memset(f, 0, sizeof(f));
  if (s[x1][y1] == '#') return 0;
  f[x1][y1] = 1;
  for (int i = x1; i <= x2; i++)
    for (int j = y1; j <= y2; j++) {
      if (i == x1 && j == y1) continue;
      if (s[i][j] == '.') f[i][j] = (f[i - 1][j] + f[i][j - 1]) % mod;
    }
  return f[x2][y2];
}
int main() {
  n = read();
  m = read();
  for (int i = 1; i <= n; i++) scanf("%s", s[i] + 1);
  ans = work(2, 1, n, m - 1) * work(1, 2, n - 1, m) -
        work(2, 1, n - 1, m) * work(1, 2, n, m - 1);
  ans %= mod;
  ans = (ans + mod) % mod;
  printf("%I64d\n", ans);
  return 0;
}
