#include <bits/stdc++.h>
using namespace std;
struct Edge {
  int from, to, dist;
  Edge(int u, int v, int d) : from(u), to(v), dist(d) {}
};
int n, m;
char s[3007][3007];
long long f1[3007][3007], f2[3007][3007];
int main() {
  ios::sync_with_stdio(false);
  while (cin >> n >> m) {
    for (int i = 1; i <= n; i++) cin >> s[i];
    f1[1][1] = f2[1][1] = 1;
    for (int i = 1; i <= n; i++) {
      for (int j = 2; j <= m; j++) {
        if (s[i][j - 1] == '.')
          f1[i][j] = (f1[i - 1][j] + f1[i][j - 1]) % 1000000007;
      }
    }
    for (int i = 2; i <= n; i++) {
      for (int j = 1; j <= m; j++) {
        if (s[i][j - 1] == '.')
          f2[i][j] = (f2[i - 1][j] + f2[i][j - 1]) % 1000000007;
      }
    }
    long long ans = ((f1[n - 1][m] * f2[n][m - 1]) % 1000000007 -
                     (f1[n][m - 1] * f2[n - 1][m]) % 1000000007 + 1000000007) %
                    1000000007;
    cout << ans << "\n";
  }
  return 0;
}
