#include <bits/stdc++.h>
using namespace std;
const int N = 2005 + 7, P = 1e9 + 7;
int read() {
  int s = 0, w = 1;
  char c;
  while (c = getchar(), c > '9' || c < '0')
    if (c == '-') w = -1;
  while (c >= '0' && c <= '9') s = s * 10 + c - '0', c = getchar();
  return s * w;
}
void write(int x) {
  if (x < 0) putchar('-'), x = -x;
  if (x >= 10) write(x / 10);
  putchar(x % 10 | '0');
}
void wsp(int x) {
  write(x);
  putchar(' ');
}
void wln(int x) {
  write(x);
  putchar('\n');
}
int n, m;
int f[N][N][2], g[N][N][2];
char s[N][N];
void Ad(int &x, int y) {
  x += y;
  if (x >= P) x -= P;
}
signed main() {
  n = read();
  m = read();
  for (int i = 1; i <= n; i++) scanf("%s", s[i] + 1);
  if (n == 1 && m == 1) {
    printf("%d\n", s[1][1] != 'R');
    return 0;
  }
  for (int i = n; i; i--)
    for (int j = m; j; j--) {
      g[i][j][0] = g[i + 1][j][0] + (s[i][j] == 'R');
      g[i][j][1] = g[i][j + 1][1] + (s[i][j] == 'R');
    }
  for (int i = n - 1; i; i--)
    if (!g[i][m][0]) f[i][m][0] = 1;
  for (int j = m - 1; j; j--)
    if (!g[n][j][1]) f[n][j][1] = 1;
  for (int i = n - 1; i; i--)
    for (int j = m - 1; j; j--) {
      Ad(f[i][j][0], f[i + 1][j][1]);
      Ad(f[i][j][1], f[i][j + 1][0]);
      if (s[i + 1][j] == 'R')
        Ad(f[i][j][0],
           (f[i + 1][j][0] - f[n - g[i + 1][j][0] + 1][j][1] + P) % P);
      else
        Ad(f[i][j][0], f[i + 1][j][0]);
      if (s[i][j + 1] == 'R')
        Ad(f[i][j][1],
           (f[i][j + 1][1] - f[i][m - g[i][j + 1][1] + 1][0] + P) % P);
      else
        Ad(f[i][j][1], f[i][j + 1][1]);
    }
  printf("%d\n", (f[1][1][0] + f[1][1][1]) % P);
}
