#include <bits/stdc++.h>
using namespace std;
const int maxn = 2005, M = 1e9 + 7;
int r[maxn][maxn], d[maxn][maxn];
int sumr[maxn][maxn], sumd[maxn][maxn];
int cntd[maxn], cntr, n, m;
char g[maxn][maxn];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%s", g[i] + 1);
  if (n == 1 && m == 1) {
    puts("1");
    return 0;
  }
  if (g[n][m] == 'R') {
    puts("0");
    return 0;
  }
  r[n][m] = d[n][m] = sumr[m][n] = sumd[n][m] = 1;
  for (int i = n; i; i--) {
    cntr = 0;
    for (int j = (i == n ? m - 1 : m); j; j--) {
      int cand = n - i - cntd[j], canr = m - j - cntr;
      d[i][j] = (sumr[j][i + 1] - sumr[j][i + 1 + cand] + M) % M;
      r[i][j] = (sumd[i][j + 1] - sumd[i][j + 1 + canr] + M) % M;
      if (g[i][j] == 'R') {
        cntd[j]++;
        cntr++;
      }
      sumd[i][j] = (sumd[i][j + 1] + d[i][j]) % M;
      sumr[j][i] = (sumr[j][i + 1] + r[i][j]) % M;
    }
  }
  printf("%d\n", (d[1][1] + r[1][1]) % M);
  return 0;
}
