#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
long long n, m;
long long dp[2][3010][3010];
char maze[3010][3010];
int main() {
  scanf("%lld%lld", &n, &m);
  memset(dp, 0, sizeof(dp));
  for (int i = 1; i <= n; i++) {
    scanf("%s", maze[i] + 1);
  }
  dp[0][1][2] = 1;
  if (maze[1][2] == '#') dp[0][1][2] = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 2; j <= m; j++) {
      if (i == 1 && j == 2) continue;
      if (j == 2) {
        dp[0][i][j] = dp[0][i - 1][j];
      } else if (i == 1) {
        dp[0][i][j] = dp[0][i][j - 1];
      } else {
        dp[0][i][j] = (dp[0][i][j - 1] + dp[0][i - 1][j]) % mod;
      }
      if (maze[i][j] == '#') {
        dp[0][i][j] = 0;
      }
    }
  }
  dp[1][2][1] = 1;
  if (maze[2][1] == '#') dp[1][2][1] = 0;
  for (int i = 2; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (i == 2 && j == 1) continue;
      if (j == 1) {
        dp[1][i][j] = dp[1][i - 1][j];
      } else if (i == 2) {
        dp[1][i][j] = dp[1][i][j - 1];
      } else {
        dp[1][i][j] = (dp[1][i][j - 1] + dp[1][i - 1][j]) % mod;
      }
      if (maze[i][j] == '#') {
        dp[1][i][j] = 0;
        ;
        ;
        ;
        ;
        ;
      }
    }
  }
  long long fans = dp[0][n - 1][m] * dp[1][n][m - 1] % mod -
                   dp[0][n][m - 1] * dp[1][n - 1][m] % mod;
  fans %= mod;
  fans += mod;
  fans %= mod;
  printf("%lld\n", fans);
  return 0;
}
