#include <bits/stdc++.h>
using namespace std;
const int maxn = 3005;
const int mo = (int)1e9 + 7;
int n, m;
char g[maxn][maxn];
int dp[2][maxn];
long long a, b, c, d, ans;
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%s", g[i] + 1);
  for (int j = 2; j <= m; j++) {
    if (g[1][j] == '#') {
      dp[1][j] = 0;
      break;
    } else
      dp[1][j] = 1;
  }
  for (int i = 2; i <= n; i++) {
    if (g[i][2] == '#')
      dp[i & 1][2] = 0;
    else
      dp[i & 1][2] = dp[~i & 1][2];
    for (int j = 3; j <= m; j++) {
      if (g[i][j] == '#')
        dp[i & 1][j] = 0;
      else
        dp[i & 1][j] = (dp[i & 1][j - 1] + dp[~i & 1][j]) % mo;
    }
  }
  c = dp[n & 1][m - 1], d = dp[~n & 1][m];
  memset(dp, 0, sizeof(dp));
  for (int j = 1; j <= m; j++) {
    if (g[2][j] == '#') {
      dp[0][j] = 0;
      break;
    } else
      dp[0][j] = 1;
  }
  for (int i = 3; i <= n; i++) {
    if (g[i][1] == '#')
      dp[i & 1][1] = 0;
    else
      dp[i & 1][1] = dp[~i & 1][1];
    for (int j = 2; j <= m; j++) {
      if (g[i][j] == '#')
        dp[i & 1][j] = 0;
      else
        dp[i & 1][j] = (dp[i & 1][j - 1] + dp[~i & 1][j]) % mo;
    }
  }
  a = dp[n & 1][m - 1], b = dp[~n & 1][m];
  ans = a * d % mo - c * b % mo;
  if (ans < 0) ans += mo;
  printf("%lld", ans);
  return 0;
}
