#include <bits/stdc++.h>
#pragma GCC optimize(3, "Ofast", "inline")
using namespace std;
const long long maxn = (long long)2e3 + 5;
const long long mod = 1000000007;
const long long inf = 0x3f3f3f3f;
long long r[maxn][maxn], d[maxn][maxn], rr[maxn][maxn], dd[maxn][maxn];
long long sumr[maxn][maxn], sumd[maxn][maxn];
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, m;
  cin >> n >> m;
  for (long long i = 1; i <= n; ++i) {
    string s;
    cin >> s;
    for (long long j = 0; j < m; ++j) {
      if (s[j] == 'R') rr[i][j + 1] = dd[i][j + 1] = 1;
    }
  }
  if (n == 1 && m == 1) {
    cout << (rr[1][1] != 1);
    return 0;
  }
  for (long long i = n; i >= 1; --i)
    for (long long j = m; j >= 1; --j) {
      dd[i][j] += dd[i][j + 1];
      rr[i][j] += rr[i + 1][j];
    }
  r[n][m] = d[n][m] = sumr[n][m] = sumd[n][m] = 1;
  for (long long i = n; i >= 1; --i) {
    for (long long j = m; j >= 1; --j) {
      if (i == n && j == m) continue;
      r[i][j] = (sumd[i][j + 1] - sumd[i][m - dd[i][j + 1] + 1]) % mod;
      d[i][j] = (sumr[i + 1][j] - sumr[n - rr[i + 1][j] + 1][j]) % mod;
      sumr[i][j] = (sumr[i + 1][j] + r[i][j]) % mod;
      sumd[i][j] = (sumd[i][j + 1] + d[i][j]) % mod;
    }
  }
  cout << ((r[1][1] + d[1][1]) % mod + mod) % mod;
  return 0;
}
