#include <bits/stdc++.h>
using namespace std;
int dx[2] = {1, 0};
int dy[2] = {0, 1};
char A[3005][3005];
int ways[3005][3005];
int X, Y;
long long count_paths(pair<int, int> s, pair<int, int> t) {
  if (s.first > t.first || s.second > t.second) return 0;
  memset(ways, 0, sizeof(ways));
  ways[s.first][s.second] = 1;
  for (int first = (s.first); first <= (t.first); ++first)
    for (int second = (s.second); second <= (t.second); ++second) {
      if (first == t.first && second == t.second) continue;
      if (A[first][second] == '#') continue;
      for (int mv = 0; mv < (2); ++mv) {
        int x2 = first + dx[mv];
        int y2 = second + dy[mv];
        if (x2 > X || y2 > Y) continue;
        if (A[x2][y2] == '#') continue;
        ways[x2][y2] = (ways[x2][y2] + ways[first][second]) % 1000000007;
      }
    }
  return ways[t.first][t.second];
}
int mat[2][2];
int main() {
  cin >> X >> Y;
  for (int i = 0; i < (X); ++i) scanf("%s", &A[i][0]);
  pair<int, int> a1(1, 0);
  pair<int, int> a2(0, 1);
  pair<int, int> b1(X - 1, Y - 2);
  pair<int, int> b2(X - 2, Y - 1);
  mat[0][0] = count_paths(a1, b1);
  mat[0][1] = count_paths(a1, b2);
  mat[1][0] = count_paths(a2, b1);
  mat[1][1] = count_paths(a2, b2);
  long long det = (1ll * mat[0][0] * mat[1][1] % 1000000007 -
                   1ll * mat[0][1] * mat[1][0] % 1000000007 + 1000000007) %
                  1000000007;
  cout << det << endl;
}
