#include <bits/stdc++.h>
using namespace std;
const int maxn = 3010, p = 1e9 + 7;
long long dp[maxn][maxn];
int n, m;
char mp[maxn][maxn];
inline long long f(int sx, int sy, int ex, int ey) {
  memset(dp, 0, sizeof(dp));
  dp[sx - 1][sy] = 1;
  for (register int i = sx; i <= ex; ++i)
    for (register int j = sy; j <= ey; ++j)
      if (mp[i][j] == '.') dp[i][j] = (dp[i - 1][j] + dp[i][j - 1]) % p;
  return dp[ex][ey];
}
int main() {
  scanf("%d%d", &n, &m);
  for (register int i = 1; i <= n; ++i) scanf("%s", mp[i] + 1);
  printf("%lld\n", (f(2, 1, n, m - 1) * f(1, 2, n - 1, m) % p -
                    f(2, 1, n - 1, m) * f(1, 2, n, m - 1) % p + p) %
                       p);
  return 0;
}
