#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
long long n, m;
long long r[2011][2011];
long long d[2011][2011];
char c[2011][2011];
long long cnt_d[2011][2011];
long long cnt_r[2011][2011];
long long col_val[2011];
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (long long i = 1; i <= n; i++)
    for (long long j = 1; j <= m; j++) cin >> c[i][j];
  if (n == 1 && m == 1) {
    cout << 1;
    return 0;
  }
  for (long long i = 1; i <= n; i++) {
    long long cur = 0;
    for (long long j = m; j >= 1; j--) {
      cnt_r[i][j] = cur;
      cur += (c[i][j] == 'R');
    }
  }
  for (long long j = 1; j <= m; j++) {
    long long cur = 0;
    for (long long i = n; i >= 1; i--) {
      cnt_d[i][j] = cur;
      cur += (c[i][j] == 'R');
    }
  }
  r[n][m] = d[n][m] = 1;
  for (long long j = m - 1; j >= 1; j--)
    if (!cnt_r[n][j]) r[n][j] = 1;
  for (long long i = n - 1; i >= 1; i--)
    if (!cnt_d[i][m]) d[i][m] = 1;
  for (long long i = n - 1; i >= 1; i--) {
    long long row_val = 0;
    for (long long j = m - 1; j >= 1; j--) {
      row_val = (row_val + d[i][j + 1]) % mod;
      if (cnt_r[i][j] > cnt_r[i][j + 1])
        row_val = ((row_val - d[i][m - cnt_r[i][j + 1]]) % mod + mod) % mod;
      r[i][j] = row_val;
      col_val[j] = (col_val[j] + r[i + 1][j]) % mod;
      if (cnt_d[i][j] > cnt_d[i + 1][j])
        col_val[j] =
            ((col_val[j] - r[n - cnt_d[i + 1][j]][j]) % mod + mod) % mod;
      d[i][j] = col_val[j];
    }
  }
  cout << (r[1][1] + d[1][1]) % mod;
}
