#include <bits/stdc++.h>
using namespace std;
const int M = 2005;
const int P = 1e9 + 7;
int n, m, f1[M][M], f2[M][M], t1[M][M], t2[M][M], s1[M][M], s2[M][M];
char g[M][M];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%s", g[i] + 1);
  for (int i = n; i >= 1; i--)
    for (int j = m; j >= 1; j--) {
      int x = (g[i][j] == 'R');
      s1[i][j] = s1[i][j + 1] + x;
      s2[i][j] = s2[i + 1][j] + x;
    }
  f1[n][m] = f2[n][m] = 1;
  t1[n][m] = t2[n][m] = 1;
  for (int i = n; i >= 1; i--)
    for (int j = m; j >= 1; j--) {
      if (i == n && j == m) continue;
      int k = m - j - s1[i][j + 1];
      f1[i][j] = (t2[i][j + 1] - t2[i][j + k + 1] + P) % P;
      k = n - i - s2[i + 1][j];
      f2[i][j] = (t1[i + 1][j] - t1[i + k + 1][j] + P) % P;
      t1[i][j] = (t1[i + 1][j] + f1[i][j]) % P;
      t2[i][j] = (t2[i][j + 1] + f2[i][j]) % P;
    }
  if (n == 1 && m == 1)
    cout << 1;
  else
    cout << (f1[1][1] + f2[1][1]) % P;
  return 0;
}
