#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int res = 0;
  int neg;
  while (true) {
    char ch = getchar();
    if (ch >= '0' && ch <= '9' || ch == '-') {
      if (ch == '-')
        neg = -1;
      else
        neg = 1, res = ch - '0';
      break;
    }
  }
  while (true) {
    char ch = getchar();
    if (ch >= '0' && ch <= '9')
      res *= 10, res += ch - '0';
    else
      break;
  }
  return res * neg;
}
const int maxn = 3020;
const int MOd = 1e9 + 7;
int a, b;
int dn[maxn][maxn];
char ar[maxn][maxn];
int add(int &a, int &b) { return a + b >= MOd ? a + b - MOd : a + b; }
long long f(int b1, int b2, int e1, int e2) {
  for (int i = 1; i <= a; i++)
    for (int j = 1; j <= b; j++) dn[i][j] = 0;
  for (int i = e1; i >= b1; i--)
    for (int j = e2; j >= b2; j--) {
      if (ar[i][j] == '#') continue;
      if (i == e1 && j == e2)
        dn[i][j] = 1;
      else
        dn[i][j] = add(dn[i][j + 1], dn[i + 1][j]);
    }
  return (long long)dn[b1][b2];
}
int main() {
  scanf("%d %d", &a, &b);
  for (int i = 1; i <= a; i++) scanf(" %s", ar[i] + 1);
  long long t = (long long)f(1, 2, a - 1, b) * f(2, 1, a, b - 1);
  long long t2 = (long long)f(1, 2, a, b - 1) * f(2, 1, a - 1, b);
  t %= MOd;
  t2 %= MOd;
  t -= t2;
  if (t < 0) t += MOd;
  cout << t << endl;
  return 0;
}
