#include <bits/stdc++.h>
using namespace std;
long long dp[2][3005][3005], m, n;
char s[3005][3005];
int go(int k, int x, int y) {
  int i, j;
  if (s[x][y] == '.') dp[k][x][y] = 1;
  for (i = x; i < n; ++i)
    for (j = y; j < m; ++j) {
      if (s[i][j] == '.' && (i != x || j != y))
        dp[k][i][j] =
            ((i >= 1 ? dp[k][i - 1][j] : 0) + (j >= 1 ? dp[k][i][j - 1] : 0)) %
            1000000007;
    }
  return 0;
}
int main() {
  int i, j, k;
  long long re;
  cin >> n >> m;
  for (i = 0; i < n; ++i) cin >> s[i];
  go(0, 0, 1), go(1, 1, 0);
  re = (long long)abs(
           (long long)dp[1][n - 1][m - 2] * dp[0][n - 2][m - 1] % 1000000007 -
           (long long)dp[1][n - 2][m - 1] * dp[0][n - 1][m - 2] % 1000000007 +
           1000000007) %
       1000000007;
  printf("%I64d\n", re);
  return 0;
}
