#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m;
  cin >> n >> m;
  vector<vector<int>> ta(n, vector<int>(m));
  for (int i = 0; i < n; i++) {
    string str;
    cin >> str;
    for (int j = 0; j < m; j++) {
      if (str[j] == 'R')
        ta[i][j] = 1;
      else
        ta[i][j] = 0;
    }
  }
  vector<vector<int>> ruiR(n, vector<int>(m)), ruiD(n, vector<int>(m));
  long long mod = 1000000007;
  vector<vector<long long>> dpR(n, vector<long long>(m)),
      dpD(n, vector<long long>(m));
  if (ta[n - 1][m - 1] == 1) {
    cout << 0 << "\n";
    return 0;
  }
  dpR[n - 1][m - 1] = dpD[n - 1][m - 1] = 1;
  for (int i = n - 2; i >= 0; i--) {
    if (ta[i][m - 1]) break;
    dpR[i][m - 1] = dpD[i][m - 1] = 1;
  }
  for (int i = n - 2; i >= 0; i--) {
    ruiD[i][m - 1] = ruiD[i + 1][m - 1];
    if (ta[i][m - 1]) {
      ruiD[i][m - 1]++;
      ruiR[i][m - 1]++;
    }
  }
  for (int j = m - 2; j >= 0; j--) {
    if (ta[n - 1][j]) break;
    dpR[n - 1][j] = dpD[n - 1][j] = 1;
  }
  for (int j = m - 2; j >= 0; j--) {
    ruiR[n - 1][j] = ruiR[n - 1][j + 1];
    if (ta[n - 1][j]) {
      ruiR[n - 1][j]++;
      ruiD[n - 1][j]++;
    }
  }
  for (int i = n - 2; i >= 0; i--) {
    for (int j = m - 2; j >= 0; j--) {
      dpR[i][j] = (dpR[i][j + 1] + dpD[i + 1][j]) % mod;
      dpD[i][j] = (dpR[i][j + 1] + dpD[i + 1][j]) % mod;
      ruiR[i][j] = ruiR[i][j + 1];
      ruiD[i][j] = ruiD[i + 1][j];
      if (ta[i][j] == 0) continue;
      ruiR[i][j]++;
      ruiD[i][j]++;
      dpR[i][j] = (dpR[i][j] + mod - dpD[i + 1][m - ruiR[i][j]]) % mod;
      dpD[i][j] = (dpD[i][j] + mod - dpR[n - ruiD[i][j]][j + 1]) % mod;
    }
  }
  cout << dpR[0][0] << "\n";
  return 0;
}
