#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
long long path[3005][3005];
char s[3005][3005];
int n, m;
void solve(int x, int y) {
  memset(path, 0, sizeof path);
  if (s[x][y] == '.') path[x][y] = 1;
  for (int i = x; i <= n; i++) {
    for (int j = y; j <= m; j++)
      if (s[i][j] == '.') {
        if (i == x && j == y) continue;
        path[i][j] = (path[i - 1][j] + path[i][j - 1]) % mod;
      }
  }
}
long long mp[5][5];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%s", s[i] + 1);
  solve(1, 2);
  mp[1][1] = path[n - 1][m];
  mp[1][2] = path[n][m - 1];
  solve(2, 1);
  mp[2][1] = path[n - 1][m];
  mp[2][2] = path[n][m - 1];
  long long ans =
      (mp[1][1] * mp[2][2] % mod - mp[1][2] * mp[2][1] % mod + mod) % mod;
  printf("%lld\n", ans);
  return 0;
}
