#include <bits/stdc++.h>
const long long int mod = 1e9 + 7;
using namespace std;
const int N = 3005;
int dp[N][N];
string second[N];
void solve1() {
  long long int n, m;
  cin >> n >> m;
  for (long long int i = 1; i < n + 1; i++) {
    cin >> second[i];
    second[i] = '0' + second[i];
  }
  dp[1][2] = 1;
  long long int p1, p2, p3, p4;
  for (long long int i = 1; i < n + 1; i++) {
    for (long long int j = 1; j < m + 1; j++) {
      if (second[i][j] == '#') dp[i][j] = 0;
      dp[i][j] %= mod;
      dp[i + 1][j] += dp[i][j];
      dp[i][j + 1] += dp[i][j];
    }
  }
  p1 = dp[n - 1][m], p3 = dp[n][m - 1];
  for (long long int i = 1; i < n + 1; i++) {
    for (long long int j = 1; j < m + 1; j++) dp[i][j] = 0;
  }
  dp[2][1] = 1;
  for (long long int i = 1; i < n + 1; i++) {
    for (long long int j = 1; j < m + 1; j++) {
      if (second[i][j] == '#') dp[i][j] = 0;
      dp[i][j] %= mod;
      dp[i + 1][j] += dp[i][j];
      dp[i][j + 1] += dp[i][j];
    }
  }
  p2 = dp[n][m - 1], p4 = dp[n - 1][m];
  cout << ((p1 * p2) % mod - (p3 * p4) % mod + mod) % mod;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  long long int t = 1;
  while (t--) {
    solve1();
  }
  return 0;
}
