#include <bits/stdc++.h>
using namespace std;
namespace IO {
const int sz = 1 << 15;
char inbuf[sz], outbuf[sz];
char *pinbuf = inbuf + sz;
char *poutbuf = outbuf;
inline char _getchar() {
  if (pinbuf == inbuf + sz) fread(inbuf, 1, sz, stdin), pinbuf = inbuf;
  return *(pinbuf++);
}
inline void _putchar(char x) {
  if (poutbuf == outbuf + sz) fwrite(outbuf, 1, sz, stdout), poutbuf = outbuf;
  *(poutbuf++) = x;
}
inline void flush() {
  if (poutbuf != outbuf)
    fwrite(outbuf, 1, poutbuf - outbuf, stdout), poutbuf = outbuf;
}
}  // namespace IO
inline int read() {
  int v = 0, f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    v = v * 10 + c - '0';
    c = getchar();
  }
  return v * f;
}
const int Maxn = 3005;
const int mod = 1e9 + 7;
int n, m;
char s[Maxn][Maxn];
int dp[Maxn][Maxn];
void Add(int &x, int y) {
  x += y;
  if (x >= mod) x -= mod;
}
int main() {
  n = read();
  m = read();
  for (int i = 0; i < n; i++) {
    scanf("%s", s[i]);
  }
  int A, B, C, D;
  memset(dp, 0, sizeof(dp));
  if (s[0][1] != '#') {
    dp[0][1] = 1;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (s[i][j] == '#') continue;
      if (i) Add(dp[i][j], dp[i - 1][j]);
      if (j) Add(dp[i][j], dp[i][j - 1]);
    }
  }
  A = dp[n - 2][m - 1], B = dp[n - 1][m - 2];
  memset(dp, 0, sizeof(dp));
  if (s[1][0] != '#') {
    dp[1][0] = 1;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (s[i][j] == '#') continue;
      if (i) Add(dp[i][j], dp[i - 1][j]);
      if (j) Add(dp[i][j], dp[i][j - 1]);
    }
  }
  C = dp[n - 2][m - 1];
  D = dp[n - 1][m - 2];
  int ans = (1ll * A * D - 1ll * B * C) % mod + mod;
  ans %= mod;
  printf("%d\n", ans);
  return 0;
}
