#include <bits/stdc++.h>
using namespace std;
const int64_t N = 3e3 + 10, mod = 1e9 + 7;
int64_t n, m, dp[N][N][2];
bool a[N][N];
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  char ch;
  for (int64_t i = 1; i <= n; i++) {
    for (int64_t j = 1; j <= m; j++) {
      cin >> ch;
      a[i][j] = (ch == '#');
    }
  }
  dp[2][1][0] = dp[1][2][1] = 1;
  for (int64_t i = 1; i <= n; i++) {
    for (int64_t j = 1; j <= m; j++) {
      if (a[i][j]) {
        dp[i][j][0] = dp[i][j][1] = 0;
        continue;
      }
      if (i == 1 && j == 2) {
        continue;
      }
      if (i == 2 && j == 1) {
        continue;
      }
      dp[i][j][0] = (dp[i - 1][j][0] + dp[i][j - 1][0]) % mod;
      dp[i][j][1] = (dp[i - 1][j][1] + dp[i][j - 1][1]) % mod;
    }
  }
  cout << (((dp[n][m - 1][0] * dp[n - 1][m][1]) % mod) -
           ((dp[n - 1][m][0] * dp[n][m - 1][1]) % mod) + mod) %
              mod;
}
