#include <bits/stdc++.h>
using namespace std;
int N, M;
char Matrix[3005][3005];
int D[2][3005][3005];
const int MOD = 1000000007;
void Read() {
  scanf("%d%d\n", &N, &M);
  for (int i = 1; i <= N; i++) scanf("%s", Matrix[i] + 1);
}
void BFS(int ind, int x, int y) {
  D[ind][x][y] = 1;
  for (int i = x; i <= N; i++)
    for (int j = y; j <= M; j++) {
      if (i == x && j == y) continue;
      if (Matrix[i][j] == '#')
        D[ind][i][j] = 0;
      else
        D[ind][i][j] = D[ind][i - 1][j] + D[ind][i][j - 1];
      D[ind][i][j] %= MOD;
    }
}
int main() {
  Read();
  if (Matrix[1][2] == '#' || Matrix[2][1] == '#' || Matrix[N - 1][M] == '#' ||
      Matrix[N][M - 1] == '#') {
    printf("0\n");
    return 0;
  }
  BFS(0, 1, 2);
  BFS(1, 2, 1);
  long long ans = (1LL * D[0][N - 1][M] * D[1][N][M - 1]) % MOD -
                  (1LL * D[1][N - 1][M] * D[0][N][M - 1]) % MOD;
  ans %= MOD;
  while (ans < 0) ans += MOD;
  printf("%I64d\n", ans);
  return 0;
}
