#include <bits/stdc++.h>
using namespace std;
const int N = 2e3 + 10;
const int mod = 1e9 + 7;
int gi() {
  int x = 0, o = 1;
  char ch = getchar();
  while ((ch < '0' || ch > '9') && ch != '-') ch = getchar();
  if (ch == '-') o = -1, ch = getchar();
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
  return x * o;
}
int n, m, f[N][N][2], s1[N][N], s2[N][N], d[N][N], r[N][N];
char s[N][N];
int add(int a, int b) { return a + b >= mod ? a + b - mod : a + b; }
int gets1(int x, int y) {
  if (x > n) return 0;
  if (~s1[x][y]) return s1[x][y];
  return s1[x][y] = add(gets1(x + 1, y), f[x][y][1]);
}
int gets2(int x, int y) {
  if (y > m) return 0;
  if (~s2[x][y]) return s2[x][y];
  return s2[x][y] = add(gets2(x, y + 1), f[x][y][0]);
}
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) scanf("%s", s[i] + 1);
  if (n == 1 && m == 1) return cout << 1, 0;
  for (int i = n; i; i--)
    for (int j = 1; j <= m; j++) d[i][j] = d[i + 1][j] + (s[i][j] == 'R');
  for (int j = m; j; j--)
    for (int i = 1; i <= n; i++) r[i][j] = r[i][j + 1] + (s[i][j] == 'R');
  memset(s1, -1, sizeof(s1));
  memset(s2, -1, sizeof(s2));
  f[n][m][0] = f[n][m][1] = 1;
  for (int i = n; i; i--)
    for (int j = m; j; j--) {
      if (i == n && j == m) continue;
      if (i + 1 <= n - d[i + 1][j]) {
        f[i][j][0] = add(gets1(i + 1, j), mod - gets1(n - d[i + 1][j] + 1, j));
      }
      if (j + 1 <= m - r[i][j + 1]) {
        f[i][j][1] = add(gets2(i, j + 1), mod - gets2(i, m - r[i][j + 1] + 1));
      }
    }
  cout << add(f[1][1][0], f[1][1][1]);
  return 0;
}
