#include <bits/stdc++.h>
using namespace std;
const int MAX_BUF_SIZE = 16384;
char BUFOR[MAX_BUF_SIZE];
int BUF_SIZE, BUF_POS;
char ZZZ;
int _MINUS;
const int MXN = 3010;
const int C = 262144;
const int INF = 1000000001;
const int MOD = 1000000007;
int n, m;
char str[MXN];
int D[MXN][MXN];
int a[MXN][MXN];
pair<int, int> cnt(int y, int x) {
  for (int i = (1); i <= (n); i++)
    for (int j = (1); j <= (m); j++) D[i][j] = 0;
  D[y][x] = (a[y][x] == 0);
  for (int i = (1); i <= (n); i++)
    for (int j = (1); j <= (m); j++)
      if (a[i][j] == 0)
        D[i][j] = (D[i][j] + (D[i - 1][j] + D[i][j - 1]) % MOD) % MOD;
  return make_pair(D[n][m - 1], D[n - 1][m]);
}
void test() {
  scanf("%d %d", &n, &m);
  for (int i = (1); i <= (n); i++) {
    scanf("%s", str + 1);
    for (int j = (1); j <= (m); j++)
      if (str[j] == '#') a[i][j] = 1;
  }
  pair<int, int> p2 = cnt(1, 2);
  pair<int, int> p1 = cnt(2, 1);
  long long int res = (((long long int)p1.first * p2.second % MOD) -
                       ((long long int)p1.second * p2.first % MOD) + MOD) %
                      MOD;
  printf("%I64d\n", res);
}
int main() {
  int te = 1;
  while (te--) test();
  return 0;
}
