#include <bits/stdc++.h>
using namespace std;
char str[3005][3005];
int dp1[3005][3005], dp2[3005][3005];
int main(void) {
  int n, m, i, j;
  scanf("%d%d", &n, &m);
  for (i = 1; i <= n; i++) scanf("%s", str[i] + 1);
  if (str[1][2] == '#' || str[2][1] == '#')
    printf("0\n");
  else {
    dp1[1][2] = dp2[2][1] = 1;
    for (i = 1; i <= n; i++) {
      for (j = 1; j <= m; j++) {
        if (i + j <= 3 || str[i][j] != '.') continue;
        dp1[i][j] = (dp1[i][j - 1] + dp1[i - 1][j]) % 1000000007;
        dp2[i][j] = (dp2[i][j - 1] + dp2[i - 1][j]) % 1000000007;
      }
    }
    printf("%lld\n", (((long long)dp1[n - 1][m] * dp2[n][m - 1] -
                       (long long)dp1[n][m - 1] * dp2[n - 1][m]) %
                          1000000007 +
                      1000000007) %
                         1000000007);
  }
  return 0;
}
