#include <bits/stdc++.h>
using namespace std;
const int N = 3e3 + 2;
const int MOD = 1e9 + 7;
int n, m;
char ch[N][N];
int dp[N][N];
long long DP(int sx, int sy, int ex, int ey) {
  if (ch[sx][sy] == '#' || ch[ex][ey] == '#') return 0;
  memset(dp, 0, sizeof(dp));
  dp[sx][sy] = 1;
  for (int i = sx; i <= ex; ++i)
    for (int j = sy; j <= ey; ++j)
      if (dp[i][j] != 0) {
        if (ch[i + 1][j] == '.') {
          dp[i + 1][j] += dp[i][j];
          if (dp[i + 1][j] >= MOD) dp[i + 1][j] -= MOD;
        }
        if (ch[i][j + 1] == '.') {
          dp[i][j + 1] += dp[i][j];
          if (dp[i][j + 1] >= MOD) dp[i][j + 1] -= MOD;
        }
      }
  return dp[ex][ey];
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; ++i) cin >> ch[i];
  cout << (DP(0, 1, n - 2, m - 1) * DP(1, 0, n - 1, m - 2) % MOD -
           DP(0, 1, n - 1, m - 2) * DP(1, 0, n - 2, m - 1) % MOD + MOD) %
              MOD
       << endl;
  return 0;
}
