#include <bits/stdc++.h>
using namespace std;
int n, m;
char c[3001][3001];
int d[3001][3001];
long long dp(int sx, int sy, int ex, int ey) {
  memset(d, 0, sizeof(d));
  if (c[sx][sy] != '#') d[sx][sy] = 1;
  for (int i = sx; i < n; i++) {
    for (int j = sy; j < m; j++) {
      if (d[i][j] > 0) {
        if (i + 1 < n && c[i + 1][j] != '#') {
          d[i + 1][j] += d[i][j];
          if (d[i + 1][j] >= 1000000007) d[i + 1][j] -= 1000000007;
        }
        if (j + 1 < m && c[i][j + 1] != '#') {
          d[i][j + 1] += d[i][j];
          if (d[i][j + 1] >= 1000000007) d[i][j + 1] -= 1000000007;
        }
      }
    }
  }
  return d[ex][ey];
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> c[i];
  }
  long long a = dp(0, 1, n - 2, m - 1), b = dp(0, 1, n - 1, m - 2),
            c = dp(1, 0, n - 2, m - 1), d = dp(1, 0, n - 1, m - 2);
  cout << ((a * d - b * c) % 1000000007 + 1000000007) % 1000000007 << endl;
  return 0;
}
