#include <bits/stdc++.h>
int n, m, P = 1e9 + 7, d[3011][3011], e[3011][3011];
char z[3011][3011];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) scanf("%s", z[i]);
  d[2][0] = e[0][2] = 1;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (z[i][j] - '#')
        d[i + 1][j + 1] = (d[i][j + 1] + d[i + 1][j]) % P,
                     e[i + 1][j + 1] = (e[i][j + 1] + e[i + 1][j]) % P;
  printf("%d", (1ll * d[n][m - 1] * e[n - 1][m] % P + P -
                1ll * e[n][m - 1] * d[n - 1][m] % P) %
                   P);
}
