#include <bits/stdc++.h>
char s[3005][3005];
int n, m;
long long dp[3005][3005];
long long ways(int sx, int sy, int ex, int ey) {
  memset(dp, 0, sizeof dp);
  dp[sx][sy] = 1;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (s[i][j] == '#') dp[i][j] = 0;
      if (i != n - 1) dp[i + 1][j] = (dp[i][j] + dp[i + 1][j]) % (1000000007LL);
      if (j != m - 1) dp[i][j + 1] = (dp[i][j] + dp[i][j + 1]) % (1000000007LL);
    }
  }
  return dp[ex][ey];
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) scanf("%s", s[i]);
  long long A = ways(0, 1, n - 2, m - 1);
  long long B = ways(1, 0, n - 1, m - 2);
  long long C = ways(0, 1, n - 1, m - 2);
  long long D = ways(1, 0, n - 2, m - 1);
  printf("%I64d\n",
         ((A * B - C * D) % (1000000007LL) + (1000000007LL)) % (1000000007LL));
  return 0;
}
