#include <bits/stdc++.h>
using namespace std;
using LL = long long;
LL bin(LL a, LL b, LL p) {
  LL res = 1;
  a = (a % p + p) % p;
  for (; b; b >>= 1, a = a * a % p)
    if (b & 1) res = res * a % p;
  return res;
}
const int N = 2005;
const int MOD = 1e9 + 7;
int dif[2][N][N];
int a[2][N][N];
int cr[N][N], rb[N][N], cl[N][N], lb[N][N];
char s[N][N];
int n, m;
inline int add(int a, int b) { return (a + b) % MOD; }
inline int sub(int a, int b) { return (a - b + MOD) % MOD; }
void output(int a[N][N]) {
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) printf("%d%c", a[i][j], j == m ? '\n' : ' ');
  }
}
void solve() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) {
    scanf("%s", s[i] + 1);
    for (int j = m; j >= 1; --j) {
      cr[i][j] = cr[i][j + 1] + (s[i][j] == 'R');
      rb[i][j] = m - cr[i][j + 1];
    }
  }
  for (int i = 1; i <= m; ++i) {
    for (int j = n; j >= 1; --j) {
      cl[j][i] = cl[j + 1][i] + (s[j][i] == 'R');
      lb[j][i] = n - cl[j + 1][i];
    }
  }
  dif[0][1][1] = 1;
  dif[0][lb[1][1] + 1][1] = -1;
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) {
      a[0][i][j] = add(a[0][i - 1][j], dif[0][i][j]);
      a[1][i][j] = add(a[1][i][j - 1], dif[1][i][j]);
      if (i < lb[i][j]) {
        dif[0][i + 1][j] = add(dif[0][i + 1][j], a[1][i][j]);
        dif[0][lb[i][j] + 1][j] = sub(dif[0][lb[i][j] + 1][j], a[1][i][j]);
      }
      if (j < rb[i][j]) {
        dif[1][i][j + 1] = add(dif[1][i][j + 1], a[0][i][j]);
        dif[1][i][rb[i][j] + 1] = sub(dif[1][i][rb[i][j] + 1], a[0][i][j]);
      }
    }
  }
  int ans = add(a[0][n][m], a[1][n][m]);
  printf("%d\n", ans);
}
int main() {
  solve();
  return 0;
}
