#include <bits/stdc++.h>
using namespace std;
const long long Mod = 1000000007LL;
const int N = 3010;
long long dp[N][N];
int n, m;
char s[N][N];
long long get(int x1, int y1, int x2, int y2) {
  memset(dp, 0, sizeof(dp));
  if (s[x1][y1] == '#') return 0;
  dp[x1][y1] = 1;
  for (int i = x1; i <= x2; i++)
    for (int j = y1; j <= y2; j++)
      if (s[i][j] == '.') {
        if (i == x1 && j == y1) continue;
        dp[i][j] = (dp[i - 1][j] + dp[i][j - 1]) % Mod;
      }
  return dp[x2][y2];
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%s", s[i] + 1);
  long long ans = (get(1, 2, n - 1, m) * get(2, 1, n, m - 1) % Mod -
                   get(1, 2, n, m - 1) * get(2, 1, n - 1, m) % Mod) %
                  Mod;
  ans = (ans + Mod) % Mod;
  cout << ans << endl;
  return 0;
}
