#include <bits/stdc++.h>
using namespace std;
long long board[3002][3002], bb[3002][3002];
pair<int, int> B[3002][3002];
const int MOD = 1000000007;
int main() {
  int kas, cas, N, M;
  while (cin >> N >> M) {
    for (int i = 0, _n = N; i < _n; i++) {
      string str;
      cin >> str;
      for (int j = 0, _n = M; j < _n; j++) {
        bb[i][j] = str[j] == '.' ? 1 : 0;
        board[i][j] = 0;
      }
    }
    B[0][0] = make_pair(1, 1);
    for (int i = 1, _n = M; i < _n; i++)
      B[0][i] =
          bb[0][i] == 1 ? make_pair(0, B[0][i - 1].second) : make_pair(0, 0);
    for (int i = 1, _n = N; i < _n; i++)
      B[i][0] =
          bb[i][0] == 1 ? make_pair(B[i - 1][0].first, 0) : make_pair(0, 0);
    for (int i = 1, _n = N; i < _n; i++) {
      for (int j = 1, _n = M; j < _n; j++) {
        long long ff = 0, ss = 0, fx = 0, fy = 0, sx = 0, sy = 0;
        if (bb[i - 1][j]) {
          fx = B[i - 1][j].first;
          sy = B[i - 1][j].second;
        }
        if (bb[i][j - 1]) {
          sx = B[i][j - 1].first;
          fy = B[i][j - 1].second;
        }
        ff = fx + sx;
        ss = fy + sy;
        if (ff > MOD) ff %= MOD;
        if (ss > MOD) ss %= MOD;
        if (!bb[i][j])
          ;
        else {
          B[i][j] = make_pair(ff, ss);
          if (sy * sx == 0)
            board[i][j] = 0;
          else
            board[i][j] = ((((sy * sx) % MOD) - (fy * fx) % MOD) + MOD) % MOD;
        }
      }
    }
    cout << board[N - 1][M - 1] << endl;
  }
  return 0;
}
