#include <bits/stdc++.h>
enum { n_max = 3300, M = 1000000007 };
inline void add_set(int &a, int b) {
  if ((a += b) >= M) a -= M;
}
char A[n_max][n_max];
int X[n_max][n_max] = {};
long long count(int x1, int y1, int x2, int y2, int n, int m) {
  memset(X, 0, sizeof X);
  if (A[x1][y1] == '#' || A[x2][y2] == '#') return 0;
  X[x1][y1] = 1;
  for (int i = 0; i < (n); ++i)
    for (int j = 0; j < (m); ++j)
      if (A[i][j] == '.') {
        if (i) add_set(X[i][j], X[i - 1][j]);
        if (j) add_set(X[i][j], X[i][j - 1]);
      }
  return X[x2][y2];
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < (n); ++i) scanf(" %s", A[i]);
  int res =
      (count(0, 1, n - 2, m - 1, n, m) * count(1, 0, n - 1, m - 2, n, m) % M -
       count(0, 1, n - 1, m - 2, n, m) * count(1, 0, n - 2, m - 1, n, m) % M +
       M) %
      M;
  printf("%d\n", res);
  return 0;
}
