#include <bits/stdc++.h>
using namespace std;
const int MaxN = 3000;
const int mod = 1000 * 1000 * 1000 + 7;
char a[MaxN][MaxN];
int dp[MaxN][MaxN];
int n, m;
long long numberPath(int stRow, int stCol, int endRow, int endCol) {
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) dp[i][j] = 0;
  if (a[stRow][stCol] != '#') dp[stRow][stCol] = 1;
  for (int i = stRow; i < n; i++)
    for (int j = stCol; j < m; j++) {
      if (i - 1 >= 0 && a[i - 1][j] == '.') {
        dp[i][j] += dp[i - 1][j];
        if (dp[i][j] >= mod) dp[i][j] -= mod;
      }
      if (j - 1 >= 0 && a[i][j - 1] == '.') {
        dp[i][j] += dp[i][j - 1];
        if (dp[i][j] >= mod) dp[i][j] -= mod;
      }
    }
  if (a[endRow][endCol] == '.')
    return dp[endRow][endCol];
  else
    return 0;
}
int main() {
  scanf("%d%d\n", &n, &m);
  if (n < 2 || m < 2) {
    printf("0");
    return 0;
  }
  for (int i = 0; i < n; i++) scanf("%s\n", a[i]);
  long long res1 = numberPath(0, 1, n - 2, m - 1);
  long long res2 = numberPath(1, 0, n - 1, m - 2);
  long long res3 = numberPath(0, 1, n - 1, m - 2);
  long long res4 = numberPath(1, 0, n - 2, m - 1);
  long long answer = res1 * res2 - res3 * res4;
  answer = (answer % mod + mod) % mod;
  printf("%lld", answer);
}
