#include <bits/stdc++.h>
using namespace std;
int ABS(int u) { return u > 0 ? u : -u; }
const int mod = 1000000007;
int n, m;
char s[3030][3030];
int f[3030][3030];
int add(int &x, int y) {
  x += y;
  if (x >= mod) {
    x -= mod;
  }
}
long long solve(int sx, int sy, int ex, int ey) {
  if (s[sx][sy] == '#' || s[ex][ey] == '#') {
    return 0;
  }
  memset(f, 0, sizeof f);
  f[sx][sy] = 1;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      if (i > 1 || j > 1) {
        if (s[i][j] == '#') {
          continue;
        }
        if (i > 1 && f[i - 1][j]) {
          add(f[i][j], f[i - 1][j]);
        }
        if (j > 1 && f[i][j - 1]) {
          add(f[i][j], f[i][j - 1]);
        }
      }
  return f[ex][ey];
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%s", s[i] + 1);
  }
  if (s[1][1] == '#' || s[n][m] == '#') {
    puts("0");
    return 0;
  }
  long long x = solve(1, 2, n - 1, m);
  long long y = solve(2, 1, n, m - 1);
  long long xx = solve(1, 2, n, m - 1);
  long long yy = solve(2, 1, n - 1, m);
  long long rlt = (x * y - xx * yy) % mod;
  printf("%I64d\n", (rlt + mod) % mod);
  return 0;
}
