#include <bits/stdc++.h>
using namespace std;
int N, M;
int F[3010][3010], G[3010][3010];
char E[3010][3010];
int main() {
  scanf("%d%d", &N, &M);
  for (int i = 0; i < N; i++) scanf("%s", E[i]);
  F[0][1] = G[1][0] = 1;
  for (int i = 0; i < N; i++)
    for (int j = 0; j < M; j++)
      if (E[i][j] == '.') {
        if (i > 0 && E[i - 1][j] == '.')
          F[i][j] += F[i - 1][j], G[i][j] += G[i - 1][j];
        if (j > 0 && E[i][j - 1] == '.')
          F[i][j] += F[i][j - 1], G[i][j] += G[i][j - 1];
        if (F[i][j] >= 1000000007) F[i][j] -= 1000000007;
        if (G[i][j] >= 1000000007) G[i][j] -= 1000000007;
      }
  N--, M--;
  cout << ((long long)F[N - 1][M] * G[N][M - 1] -
           (long long)F[N][M - 1] * G[N - 1][M] +
           (long long)1000000007 * 1000000007) %
              1000000007
       << endl;
  return 0;
}
