#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const long long MAX = 200010;
const long long MOD = (long long)1e9 + 7;
const long long INF = 1e9;
const long long LLINF = 0x3f3f3f3f3f3f3f3f;
const long double EPS = 1e-8;
struct FT {
  vector<long long> bit;
  long long n;
  FT(long long n) {
    this->n = n + 1;
    bit.assign(n + 2, 0);
  }
  long long sum(long long idx) {
    long long ret = 0;
    for (++idx; idx > 0; idx -= idx & -idx) ret = (ret + bit[idx]) % MOD;
    return ret;
  }
  long long sum(long long l, long long r) {
    if (l > r) return 0;
    return (sum(r) - sum(l - 1) + MOD) % MOD;
  }
  void add(long long idx, long long delta) {
    for (++idx; idx < n; idx += idx & -idx) bit[idx] = (bit[idx] + delta) % MOD;
  }
};
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long n, m;
  cin >> n >> m;
  long long down[n][m], right[n][m];
  char mat[n][m];
  for (long long i = 0; i < (long long)n; i++) {
    for (long long j = 0; j < (long long)m; j++) {
      cin >> mat[i][j];
    }
  }
  if (mat[n - 1][m - 1] == 'R') {
    cout << 0 << '\n';
    return 0;
  }
  if (n == 1 and m == 1) {
    cout << 1 << '\n';
    return 0;
  }
  for (long long j = m - 1; j >= 0; j--) {
    long long soma = 0;
    for (long long i = n - 1; i >= 0; i--) {
      down[i][j] = soma;
      soma += (mat[i][j] == 'R');
    }
  }
  for (long long i = n - 1; i >= 0; i--) {
    long long soma = 0;
    for (long long j = m - 1; j >= 0; j--) {
      right[i][j] = soma;
      soma += (mat[i][j] == 'R');
    }
  }
  vector<FT> tab1(2001, FT(2001));
  vector<FT> tab0(2001, FT(2001));
  tab1[n - 1].add(m - 1, 1);
  tab0[m - 1].add(n - 1, 1);
  for (long long i = n - 1; i >= 0; i--) {
    for (long long j = m - 1; j >= 0; j--) {
      if (i == n - 1 and j == m - 1) continue;
      long long val = tab0[j].sum(i + 1, n - 1 - down[i][j]);
      tab1[i].add(j, val);
    }
    for (long long j = m - 1; j >= 0; j--) {
      if (i == n - 1 and j == m - 1) continue;
      long long val = tab1[i].sum(j + 1, m - 1 - right[i][j]);
      tab0[j].add(i, val);
    }
  }
  long long res = (tab0[0].sum(0, 0) + tab1[0].sum(0, 0)) % MOD;
  cout << res << '\n';
  return 0;
}
