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