#include <bits/stdc++.h>
using namespace std;
const int mod = (int)(1e9 + 7);
int n, m, dp[3005][3005];
char second[3005][3005];
long long calc(int a, int b, int c, int d) {
  if (second[a][b] == '#' || second[c][d] == '#') return 0;
  memset(dp, 0, sizeof(dp));
  dp[a][b] = 1;
  for (int i = a; i <= c; ++i) {
    for (int j = b; j <= d; ++j)
      if (second[i][j] == '.') {
        if (second[i - 1][j] == '.') dp[i][j] += dp[i - 1][j];
        if (second[i][j - 1] == '.') dp[i][j] += dp[i][j - 1];
        if (dp[i][j] >= mod) dp[i][j] -= mod;
      }
  }
  return dp[c][d];
}
int main() {
  scanf("%d%d\n", &n, &m);
  for (int i = 1; i <= n; ++i) gets(second[i] + 1);
  long long res = calc(1, 2, n - 1, m) * calc(2, 1, n, m - 1) -
                  calc(1, 2, n, m - 1) * calc(2, 1, n - 1, m);
  res %= mod;
  if (res < 0) res += mod;
  cout << res;
  return 0;
}
