#include <bits/stdc++.h>
const int dx[] = {1, 0};
const int dy[] = {0, 1};
using namespace std;
long long dp[3030][3030];
string field[3030];
const long long MOD = 1e9 + 7;
int n, m;
long long calc(int y1, int x1, int y2, int x2) {
  memset(dp, 0, sizeof(dp));
  dp[y1][x1] = (field[y1][x1] != '#');
  for (int y = 0; y < n; y++)
    for (int x = 0; x < m; x++) {
      if (field[y][x] == '#') continue;
      for (int k = 0; k < 2; k++) {
        int ny = y + dy[k];
        int nx = x + dx[k];
        if (ny >= n || nx >= m) continue;
        if (field[ny][nx] == '#') continue;
        dp[ny][nx] += dp[y][x];
        dp[ny][nx] %= MOD;
      }
    }
  return dp[y2][x2];
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> field[i];
  long long ans = (calc(0, 1, n - 2, m - 1) * calc(1, 0, n - 1, m - 2) -
                   calc(1, 0, n - 2, m - 1) * calc(0, 1, n - 1, m - 2));
  ans %= MOD;
  if (ans < 0) ans += MOD;
  cout << ans << endl;
  return 0;
}
