#include <bits/stdc++.h>
using namespace std;
const int N = 3e3 + 100;
const int mod = 1e9 + 7;
const long long int inf = 1e17;
string c[N];
long long int a[N][N];
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> c[i];
  if (c[0][1] == '.') a[0][1] = 1;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (c[i][j] == '.') {
        if (i != 0) a[i][j] += a[i - 1][j];
        if (j != 0) a[i][j] += a[i][j - 1];
        a[i][j] %= mod;
      }
    }
  }
  long long int bc = a[n - 1][m - 2], bd = a[n - 2][m - 1];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) a[i][j] = 0;
  if (c[1][0] == '.') a[1][0] = 1;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (c[i][j] == '.') {
        if (i != 0) a[i][j] += a[i - 1][j];
        if (j != 0) a[i][j] += a[i][j - 1];
        a[i][j] %= mod;
      }
    }
  }
  long long int ac = a[n - 1][m - 2], ad = a[n - 2][m - 1];
  cout << ((ac * bd) % mod - (ad * bc) % mod + mod) % mod << endl;
  return 0;
}
