#include <bits/stdc++.h>
const int MOD = 1000000007;
int DP1[3005][3005], DP2[3005][3005];
char s[3005][3005];
int main() {
  int N, M;
  scanf("%d%d", &N, &M);
  for (int i = 1; i <= N; i++) scanf("%s", s[i] + 1);
  DP1[1][2] = 1, DP2[2][1] = 1;
  for (int i = 1; i <= N; i++) {
    for (int j = 1; j <= M; j++) {
      if (s[i][j] == '#')
        DP1[i][j] = DP2[i][j] = 0;
      else {
        if (i != 1 || j != 2) DP1[i][j] = (DP1[i - 1][j] + DP1[i][j - 1]) % MOD;
        if (i != 2 || j != 1) DP2[i][j] = (DP2[i - 1][j] + DP2[i][j - 1]) % MOD;
      }
    }
  }
  printf("%lld", ((long long)DP1[N - 1][M] * DP2[N][M - 1] % MOD -
                  (long long)DP1[N][M - 1] * DP2[N - 1][M] % MOD + MOD) %
                     MOD);
  return 0;
}
