#include <bits/stdc++.h>
using namespace std;
char s[4000][4000];
long long f[4000][4000];
int n, m;
long long get(int x, int y) {
  if (x < 0 || y < 0) return 0;
  if (s[x][y] == '#') return 0;
  if (f[x][y] >= 0) return f[x][y];
  return f[x][y] = (get(x - 1, y) + get(x, y - 1)) % 1000000007;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; ++i) {
    scanf("%s", s[i]);
  }
  memset((f), (-1), sizeof((f)));
  f[0][1] = 1;
  long long p1 = get(n - 2, m - 1);
  long long p3 = get(n - 1, m - 2);
  memset((f), (-1), sizeof((f)));
  f[1][0] = 1;
  long long p2 = get(n - 1, m - 2);
  long long p4 = get(n - 2, m - 1);
  long long res1 = p1 * p2;
  res1 += 1000000007;
  res1 %= 1000000007;
  long long res2 = p3 * p4;
  res2 += 1000000007;
  res2 %= 1000000007;
  long long ans = res1 - res2;
  ans = (ans % 1000000007) + 1000000007;
  ans %= 1000000007;
  cout << ans << endl;
  return 0;
}
