#include <bits/stdc++.h>
inline int getint() {
  int x = 0, p = 1;
  char c = getchar();
  while (c <= 32) c = getchar();
  if (c == 45) p = -p, c = getchar();
  while (c > 32) x = x * 10 + c - 48, c = getchar();
  return x * p;
}
using namespace std;
const int N = 2005;
int n, m, dp[N][N][2], sx[N][N], sy[N][N], px[N][N], py[N][N];
char a[N][N];
inline void add(int &x, int y) {
  x += y;
  if (x >= 1000000007) x -= 1000000007;
}
inline int sub2(int x, int y) {
  x -= y;
  return (x < 0) ? x + 1000000007 : x;
}
int main() {
  n = getint();
  m = getint();
  for (int(i) = 0; (i) < (n); (i)++) scanf("%s", a[i]);
  if (n == 1 && m == 1) {
    if (a[0][0] == '.')
      printf("%d\n", 1);
    else
      printf("%d\n", 0);
    return 0;
  }
  for (int(i) = 0; (i) < (n); (i)++)
    for (int j = m - 1; j >= 0; j--) px[i][j] = px[i][j + 1] + (a[i][j] == 'R');
  for (int(j) = 0; (j) < (m); (j)++)
    for (int i = n - 1; i >= 0; i--) py[i][j] = py[i + 1][j] + (a[i][j] == 'R');
  for (int i = n - 1; i >= 0; i--)
    for (int j = m - 1; j >= 0; j--) {
      if (i == n - 1 && j == m - 1) {
        if (a[i][j] == 'R') continue;
        for (int(k) = 0; (k) < (2); (k)++) dp[i][j][k] = 1;
        sx[i][j] = sy[i][j] = 1;
        continue;
      }
      if (px[i][j] < m - j && py[i][j] < n - i) {
        add(dp[i][j][0], sub2(sx[i][j + 1], sx[i][m - px[i][j + 1]]));
        add(dp[i][j][1], sub2(sy[i + 1][j], sy[n - py[i + 1][j]][j]));
      }
      add(sx[i][j], sx[i][j + 1]);
      add(sx[i][j], dp[i][j][1]);
      add(sy[i][j], sy[i + 1][j]);
      add(sy[i][j], dp[i][j][0]);
    }
  printf("%d\n", (dp[0][0][0] + dp[0][0][1]) % 1000000007);
  return 0;
}
