#include <bits/stdc++.h>
using namespace std;
const long double PI = 3.14159265359;
const long long MOD = (long long)1e9 + 7;
const long long MAXN = (long long)3e3 + 10;
const long long INF = (long long)9223372036854775;
const long double EPS = (long double)1e-8;
long long nw1[MAXN][MAXN], nw2[MAXN][MAXN];
string ma[MAXN];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> ma[i];
  if (ma[1][0] == '.') nw1[2][1] = 1;
  if (ma[0][1] == '.') nw2[1][2] = 1;
  for (int i = 2; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (i == 2 and j == 1) continue;
      if (ma[i - 1][j - 1] == '#')
        nw1[i][j] = 0;
      else
        nw1[i][j] = (nw1[i - 1][j] + nw1[i][j - 1]) % MOD;
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 2; j <= m; j++) {
      if (i == 1 and j == 2) continue;
      if (ma[i - 1][j - 1] == '#')
        nw2[i][j] = 0;
      else
        nw2[i][j] = (nw2[i - 1][j] + nw2[i][j - 1]) % MOD;
    }
  }
  long long ans = (nw1[n][m] * nw2[n][m]) % MOD;
  ans = ans - (nw1[n - 1][m] * nw2[n - 1][m]);
  ans %= MOD;
  ans = ans - (nw1[n][m - 1] * nw2[n][m - 1]);
  ans %= MOD;
  ans = ans - 2 * (nw1[n - 1][m] * nw2[n][m - 1]);
  ans %= MOD;
  cout << (ans + MOD) % MOD;
  return 0;
}
