#include <bits/stdc++.h>
using namespace std;
long long a, b, l[3001][3001], dp[3001][3001], mod = 1000000007;
char cc;
long long find(long long aa, long long bb, long long qq, long long ww) {
  if (l[aa][bb] == 2) return 0;
  memset(dp, 0, sizeof(dp));
  dp[aa][bb] = 1;
  for (int i = aa; i <= qq; i++) {
    for (int j = bb; j <= ww; j++) {
      if (i == aa && j == bb) continue;
      if (l[i][j] == 2) continue;
      dp[i][j] = dp[i - 1][j] + dp[i][j - 1];
      dp[i][j] %= 1000000007;
    }
  }
  return dp[qq][ww] % 1000000007;
}
int main() {
  scanf("%lld%lld", &a, &b);
  getchar();
  for (int i = 1; i <= a; i++) {
    for (int j = 1; j <= b; j++) {
      l[i][j] = (getchar() == '.') ? 1 : 2;
    }
    getchar();
  }
  printf("%lld", ((find(1, 2, a - 1, b) * find(2, 1, a, b - 1) % 1000000007 -
                   find(1, 2, a, b - 1) * find(2, 1, a - 1, b)) %
                      1000000007 +
                  1000000007) %
                     1000000007);
  return 0;
}
