#include <bits/stdc++.h>
using namespace std;
const long long M = 1000000007LL;
long long ways[3005][3005], n, m;
bool blocked[3005][3005];
long long f(pair<long long, long long> a, pair<long long, long long> b) {
  memset(ways, 0, sizeof(ways));
  for (long long i = a.first; i <= b.first; i++) {
    for (long long j = a.second; j <= b.second; j++) {
      ways[i][j] = 0;
      if (blocked[i][j]) continue;
      if (i > a.first) ways[i][j] += ways[i - 1][j];
      if (j > a.second) ways[i][j] += ways[i][j - 1];
      if (i == a.first and j == a.second) ways[i][j] = 1LL;
      ways[i][j] += M;
      ways[i][j] %= M;
    }
  }
  return ways[b.first][b.second];
}
long long solve() {
  pair<long long, long long> a1, b1, a2, b2;
  a1 = {0LL, 1LL};
  a2 = {1LL, 0LL};
  b1 = {n - 2LL, m - 1LL};
  b2 = {n - 1LL, m - 2LL};
  long long r1 = (f(a1, b1) * f(a2, b2));
  long long r2 = (f(a1, b2) * f(a2, b1));
  return (r1 - r2 + M + M) % M;
}
int main() {
a:
  ios::sync_with_stdio(0);
  cin >> n >> m;
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < m; j++) {
      char c;
      cin >> c;
      blocked[i][j] = (c == '#');
    }
  }
  cout << (solve() + M * 10) % M << '\n';
}
