#include <bits/stdc++.h>
using namespace std;
int const mo = (int)(1e9 + 7);
int f[2][3010][3010];
char a[3010][3010];
int m, n;
void work(int k, int x, int y) {
  if (a[x][y] == '.') f[k][x][y] = 1;
  for (int i = x; i <= n; i++) {
    for (int j = y; j <= m; j++) {
      if (a[i][j] == '.' && (i != x || j != y)) {
        f[k][i][j] = (f[k][i - 1][j] + f[k][i][j - 1]) % mo;
      }
    }
  }
}
void sovle() {
  work(0, 1, 2);
  work(1, 2, 1);
  long long ans = (1LL * (long long)f[0][n - 1][m] * f[1][n][m - 1] % mo -
                   1LL * (long long)f[0][n][m - 1] * f[1][n - 1][m] % mo + mo) %
                  mo;
  cout << ans << endl;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%s", a[i] + 1);
  }
  sovle();
  return 0;
}
