#include <bits/stdc++.h>
using namespace std;
const int MXN = 800000;
const int MOD = 1000000007;
int dp[3003][3003], a[3003][3003];
int n, m;
string s;
long long cnt(int x1, int Y1, int x2, int y2) {
  memset(dp, 0, sizeof(dp));
  dp[x1][Y1] = 1;
  for (int i = x1; i < n; ++i)
    for (int j = Y1; j < m; ++j)
      if (a[i][j] == 1)
        dp[i][j] = 0;
      else {
        dp[i + 1][j] = (dp[i + 1][j] + dp[i][j]) % MOD;
        dp[i][j + 1] = (dp[i][j + 1] + dp[i][j]) % MOD;
      }
  return dp[x2][y2];
}
int main() {
  cin >> n >> m;
  getline(cin, s);
  for (int i = 0; i < n; ++i) {
    getline(cin, s);
    for (int j = 0; j < m; ++j)
      if (s[j] == '#')
        a[i][j] = 1;
      else
        a[i][j] = 0;
  }
  long long ans = cnt(0, 1, n - 2, m - 1) * cnt(1, 0, n - 1, m - 2) -
                  cnt(0, 1, n - 1, m - 2) * cnt(1, 0, n - 2, m - 1);
  ans = (ans % MOD + MOD) % MOD;
  cout << ans << endl;
}
