#include <bits/stdc++.h>
using namespace std;
int main() {
  long long h, w;
  cin >> h >> w;
  vector<string> s(h);
  for (int i = 0; i < h; i++) {
    cin >> s[i];
  }
  vector<vector<long long> > sd(h + 1, vector<long long>(w + 1, 0));
  vector<vector<long long> > sr(h + 1, vector<long long>(w + 1, 0));
  for (int i = h - 1; i >= 0; i--) {
    for (int j = w - 1; j >= 0; j--) {
      sd[i][j] = sd[i + 1][j] + (s[i][j] == 'R');
      sd[i][j] %= 1000000007;
      sr[i][j] = sr[i][j + 1] + (s[i][j] == 'R');
      sr[i][j] %= 1000000007;
    }
  }
  vector<vector<long long> > dpd(h + 5, vector<long long>(w + 5, 0));
  vector<vector<long long> > dpr(h + 5, vector<long long>(w + 5, 0));
  for (int i = h - 1; i >= 0; i--) {
    for (int j = w - 1; j >= 0; j--) {
      if (i == h - 1 && j == w - 1) {
        continue;
      }
      dpr[i][j] = dpr[i][j + 1] + dpd[i][j + 1];
      dpr[i][j] %= 1000000007;
      dpd[i][j] = dpd[i + 1][j] + dpr[i + 1][j];
      dpd[i][j] %= 1000000007;
      if (i < h - 1 && s[i + 1][j] == 'R') {
        dpd[i][j] -= dpr[h - sd[i + 1][j]][j];
        dpd[i][j] = (dpd[i][j] + 1000000007) % 1000000007;
      }
      if (j < w - 1 && s[i][j + 1] == 'R') {
        dpr[i][j] -= (dpd[i][w - sr[i][j + 1]]);
        dpr[i][j] = (dpr[i][j] + 1000000007) % 1000000007;
      }
      if (i == h - 1) {
        dpr[i][j] = (sr[i][j + 1] == 0 ? 1 : 0);
        dpr[i][j] = (dpr[i][j] + 1000000007) % 1000000007;
      }
      if (j == w - 1) {
        dpd[i][j] = (sd[i + 1][j] == 0 ? 1 : 0);
        dpd[i][j] = (dpd[i][j] + 1000000007) % 1000000007;
      }
    }
  }
  long long ans = dpd[0][0] + dpr[0][0];
  ans %= 1000000007;
  if (h == 1 && w == 1 && s[0][0] == '.') {
    ans = 1;
  }
  cout << ans << endl;
}
