#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7, MAX = 3010;
char a[MAX][MAX];
int dp1[MAX][MAX], dp2[MAX][MAX];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) scanf("%s", a[i]);
  if (a[1][0] != '#') dp1[0][1] = 1;
  if (a[0][1] != '#') dp2[1][0] = 1;
  for (int i = 0; i < n; i++) {
    for (int j = 1; j < m; j++) {
      if (a[i][j] != '#') {
        if ((i - 1) >= 0) dp1[i][j] = (dp1[i][j] + dp1[i - 1][j]) % MOD;
        if ((j - 1) >= 0) dp1[i][j] = (dp1[i][j] + dp1[i][j - 1]) % MOD;
      }
    }
  }
  for (int i = 1; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (a[i][j] != '#') {
        if ((i - 1) >= 0) dp2[i][j] = (dp2[i][j] + dp2[i - 1][j]) % MOD;
        if ((j - 1) >= 0) dp2[i][j] = (dp2[i][j] + dp2[i][j - 1]) % MOD;
      }
    }
  }
  int sol = (1ll * dp1[n - 2][m - 1] * dp2[n - 1][m - 2] % MOD);
  int tmp = (1ll * dp2[n - 2][m - 1] * dp1[n - 1][m - 2] % MOD);
  sol = ((sol - tmp) % MOD + MOD) % MOD;
  printf("%d", sol);
  return 0;
}
