#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
int N, M;
char A[3012][3012];
int D[3012][3012];
int roads(int xn1, int yn1, int xn2, int yn2) {
  if (A[xn1][yn1] == '#') return 0;
  memset(D, 0, sizeof(D));
  D[xn1][yn1] = 1;
  for (int i = 1; i <= N; ++i)
    for (int j = 1; j <= M; ++j)
      if (D[i][j] == 0 && A[i][j] != '#') {
        D[i][j] = D[i - 1][j] + D[i][j - 1];
        if (D[i][j] >= MOD) D[i][j] -= MOD;
      }
  return D[xn2][yn2];
}
int main() {
  cin.sync_with_stdio(false);
  cin >> N >> M;
  for (int i = 1; i <= N; ++i) cin >> (A[i] + 1);
  int result = 1LL * roads(1, 2, N - 1, M) * roads(2, 1, N, M - 1) % MOD -
               1LL * roads(1, 2, N, M - 1) * roads(2, 1, N - 1, M) % MOD;
  if (result < 0) result += MOD;
  if (result >= MOD) result -= MOD;
  cout << result << '\n';
}
