#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int M, N;
bool t[3010][3010];
long long f[3010][3010][2];
int main() {
  cin >> M >> N;
  for (int i = 1; i <= M; i++) {
    getchar();
    for (int j = 1; j <= N; j++) {
      char c = getchar();
      if (c == '.') t[i][j] = true;
    }
  }
  if (t[1][2]) f[1][2][0] = 1;
  if (t[2][1]) f[2][1][1] = 1;
  for (int i = 1; i <= M; i++)
    for (int j = 1; j <= N; j++)
      for (int k = 0; k <= 1; k++)
        if (t[i][j])
          f[i][j][k] = (f[i][j][k] + f[i - 1][j][k] + f[i][j - 1][k]) % mod;
  cout << ((f[M - 1][N][0] * f[M][N - 1][1] % mod -
            f[M - 1][N][1] * f[M][N - 1][0] % mod) %
               mod +
           mod) %
              mod;
  return 0;
}
