#include <bits/stdc++.h>
using namespace std;
void dout() { cerr << "\n"; }
template <typename Head, typename... Tail>
void dout(Head H, Tail... T) {
  cerr << H << ' ';
  dout(T...);
}
long long bit(signed x) { return __builtin_popcount(x); }
long long bit(long long x) { return __builtin_popcountll(x); }
const long long N = 2007, MOD = 1e9 + 7;
long long n, m, a[N][N], up[N][N], alimq[N][N], pc[N][N], pr[N][N], cs[N][N],
    rs[N][N];
void add(long long& x, long long y) {
  x += y;
  if (x < 0) {
    x += MOD;
  }
  if (x >= MOD) {
    x -= MOD;
  }
}
long long getup(long long x, long long y) {
  long long val = n - x + 1 - (cs[n][y] - cs[x - 1][y]);
  long long l = 0, r = x;
  while (l < r - 1) {
    long long mid = l + r >> 1;
    if (cs[x - 1][y] - cs[mid][y] >= val) {
      l = mid;
    } else {
      r = mid;
    }
  }
  return pc[x - 1][y] - pc[l][y];
}
long long getleft(long long x, long long y) {
  long long val = m - y + 1 - (rs[x][m] - rs[x][y - 1]);
  long long l = 0, r = y;
  while (l < r - 1) {
    long long mid = l + r >> 1;
    if (rs[x][y - 1] - rs[x][mid] >= val) {
      l = mid;
    } else {
      r = mid;
    }
  }
  return pr[x][y - 1] - pr[x][l];
}
void solve(long long tc) {
  cin >> n >> m;
  for (long long i = 1; i <= n; i++) {
    for (long long j = 1; j <= m; j++) {
      char c;
      cin >> c;
      rs[i][j] = rs[i][j - 1];
      cs[i][j] = cs[i - 1][j];
      if (c == 'R') {
        a[i][j] = 1;
        rs[i][j]++;
        cs[i][j]++;
      }
    }
  }
  if (n == 1 && m == 1) {
    cout << 1 - a[1][1];
    return;
  }
  up[1][1] = 1;
  alimq[1][1] = 1;
  for (long long i = 1; i <= n; i++) {
    for (long long j = 1; j <= m; j++) {
      add(up[i][j], getup(i, j));
      add(alimq[i][j], getleft(i, j));
      pc[i][j] = pc[i - 1][j];
      add(pc[i][j], alimq[i][j]);
      pr[i][j] = pr[i][j - 1];
      add(pr[i][j], up[i][j]);
    }
  }
  cout << (up[n][m] + alimq[n][m]) % MOD;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long tc = 1;
  for (long long i = 0; i < tc; i++) {
    solve(i);
  }
}
