#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const int MAXn = 3000 + 17;
bool mat[MAXn][MAXn];
int dp[MAXn][MAXn];
int n, m;
void CLR() {
  for (int i = 0; i < MAXn; i++)
    for (int j = 0; j < MAXn; j++) dp[i][j] = 0;
}
long long path(pair<int, int> a, pair<int, int> b) {
  CLR();
  dp[a.first + 1][a.second + 1] = mat[a.first][a.second];
  for (int i = a.first; i <= b.first; i++) {
    for (int j = a.second; j <= b.second; j++) {
      if (i == a.first && j == a.second) continue;
      dp[i + 1][j + 1] = ((dp[i][j + 1] + dp[i + 1][j]) % MOD) * mat[i][j];
    }
  }
  return dp[b.first + 1][b.second + 1] % MOD;
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    string x;
    cin >> x;
    for (int j = 0; j < m; j++) {
      mat[i][j] = (x[j] == '.');
    }
  }
  pair<int, int> p1 = make_pair(0, 1);
  pair<int, int> p2 = make_pair(1, 0);
  pair<int, int> p3 = make_pair(n - 2, m - 1);
  pair<int, int> p4 = make_pair(n - 1, m - 2);
  long long path13 = path(p1, p3);
  long long path14 = path(p1, p4);
  long long path23 = path(p2, p3);
  long long path24 = path(p2, p4);
  if (0)
    if (0)
      cerr << "path13"
           << " = " << path13 << endl;
  if (0)
    if (0)
      cerr << "path14"
           << " = " << path14 << endl;
  if (0)
    if (0)
      cerr << "path23"
           << " = " << path23 << endl;
  if (0)
    if (0)
      cerr << "path24"
           << " = " << path24 << endl;
  cout << (((path13 * path24 - path14 * path23) % MOD + MOD) % MOD) << endl;
  return 0;
}
