#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
const int MAXN = 2e3 + 5;
const int INF = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
int M[MAXN][MAXN];
int dp[MAXN][MAXN][2];
int pr[MAXN][MAXN][2];
int prdp[MAXN][MAXN][2];
void solve() {
  ll n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    for (int j = 0; j < m; j++) {
      if (s[j] == 'R') {
        M[i][j] = 1;
      }
    }
  }
  for (int i = n - 1; i >= 0; i--) {
    for (int j = m - 1; j >= 0; j--) {
      pr[i][j][0] = pr[i][j + 1][0] + M[i][j];
      pr[i][j][1] = pr[i + 1][j][1] + M[i][j];
    }
  }
  dp[n - 1][m - 1][0] = 1;
  dp[n - 1][m - 1][1] = 1;
  prdp[n - 1][m - 1][0] = 1;
  prdp[n - 1][m - 1][1] = 1;
  for (int i = n - 1; i >= 0; i--) {
    for (int j = m - 1; j >= 0; j--) {
      if (i == n - 1 && j == m - 1) continue;
      if (j == m - 1) {
        if (pr[i + 1][j][1] == 0) dp[i][j][0] = prdp[i + 1][j][1];
      } else if (i == n - 1) {
        if (pr[i][j + 1][0] == 0) dp[i][j][1] = prdp[i][j + 1][0];
      } else {
        if (i + 1 <= n - 1 - pr[i + 1][j][1]) {
          dp[i][j][0] = prdp[i + 1][j][1] - prdp[n - pr[i + 1][j][1]][j][1];
        }
        if (j + 1 <= m - 1 - pr[i][j + 1][0]) {
          dp[i][j][1] = prdp[i][j + 1][0] - prdp[i][m - pr[i][j + 1][0]][0];
        }
      }
      for (int k = 0; k < 2; k++) {
        if (dp[i][j][k] < 0) dp[i][j][k] += MOD;
      }
      prdp[i][j][1] = (dp[i][j][1] + prdp[i + 1][j][1]) % MOD;
      prdp[i][j][0] = (dp[i][j][0] + prdp[i][j + 1][0]) % MOD;
    }
  }
  ll ans = (dp[0][0][0] + dp[0][0][1]) % MOD;
  if (n == 1 && m == 1) ans = 1;
  cout << ans << '\n';
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
