#include <bits/stdc++.h>
using namespace std;
int n, m;
int dp[3010][3010];
char s[3010][3010];
int dfs(int x, int y, int a, int b) {
  if (x == a && y == b) return 1;
  int &ret = dp[x][y];
  if (ret != -1) return ret;
  ret = 0;
  if (x + 1 < n && s[x + 1][y] != '#') {
    ret += dfs(x + 1, y, a, b);
  }
  if (y + 1 < m && s[x][y + 1] != '#') {
    ret += dfs(x, y + 1, a, b);
  }
  if (ret >= 1000000007) ret -= 1000000007;
  return ret;
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    scanf("%s", s[i]);
  }
  if (s[0][1] == '#' || s[1][0] == '#') {
    cout << 0 << endl;
    return 0;
  }
  memset(dp, -1, sizeof dp);
  long long a = dfs(1 - 1, 2 - 1, n - 1 - 1, m - 1);
  memset(dp, -1, sizeof dp);
  long long b = dfs(2 - 1, 1 - 1, n - 1, m - 1 - 1);
  memset(dp, -1, sizeof dp);
  long long c = dfs(1 - 1, 2 - 1, n - 1, m - 1 - 1);
  memset(dp, -1, sizeof dp);
  long long d = dfs(2 - 1, 1 - 1, n - 1 - 1, m - 1);
  long long ans = ((a * b) % 1000000007 - (c * d) % 1000000007) % 1000000007;
  cout << (ans + 1000000007) % 1000000007 << endl;
  return 0;
}
