#include <bits/stdc++.h>
using namespace std;
const int maxn = 2005;
const int mod = 1e9 + 7;
int dp[maxn][maxn][2];
int suf[maxn][maxn][2];
string mp[maxn];
void add(int &x, int y) { x = (x + y) % mod; }
void sub(int &x, int y) {
  y %= mod;
  x = (x + mod - y) % mod;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  if (n == 1 && m == 1) {
    cout << 1 << endl;
    return 0;
  }
  for (int i = 1; i <= n; i++) {
    cin >> mp[i];
    mp[i] = "#" + mp[i];
  }
  for (int i = n; i >= 1; i--) {
    for (int j = m; j >= 1; j--) {
      suf[i][j][1] = suf[i][j + 1][1] + (mp[i][j] == 'R');
      suf[i][j][0] = suf[i + 1][j][0] + (mp[i][j] == 'R');
    }
  }
  for (int i = n; i >= 1; i--) {
    for (int j = m; j >= 1; j--) {
      if (i == n && j == m) continue;
      dp[i][j][0] = (dp[i + 1][j][0] + dp[i + 1][j][1]) % mod;
      dp[i][j][1] = (dp[i][j + 1][0] + dp[i][j + 1][1]) % mod;
      if (i < n && mp[i + 1][j] == 'R')
        dp[i][j][0] =
            (dp[i][j][0] - dp[n - suf[i + 1][j][0] + 1][j][1] + mod) % mod;
      if (j < m && mp[i][j + 1] == 'R')
        dp[i][j][1] =
            (dp[i][j][1] - dp[i][m - suf[i][j + 1][1] + 1][0] + mod) % mod;
      if (i == n) dp[i][j][1] = (suf[i][j + 1][1] == 0 ? 1 : 0);
      if (j == m) dp[i][j][0] = (suf[i + 1][j][0] == 0 ? 1 : 0);
    }
  }
  cout << (dp[1][1][0] + dp[1][1][1]) % mod << endl;
}
