#include <bits/stdc++.h>
using namespace std;
template <class T>
bool tomax(T &x, T y) {
  if (x < y) return x = y, 1;
  return 0;
}
template <class T>
bool tomin(T &x, T y) {
  if (x > y) return x = y, 1;
  return 0;
}
const int P = 1e9 + 7;
void calc(int &x, int y) {
  x += y;
  if (x >= P) x -= P;
}
void Mul(int &x, int y) {
  x += y;
  if (x >= P) x -= P;
}
char Map[2005][2005];
int R[2005][2005], D[2005][2005];
int dp[2005][2005];
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) scanf("%s", Map[i] + 1);
  for (int i = 1; i <= n; i++) {
    int res = 0;
    for (int j = m; j >= 1; j--) {
      R[i][j] = res;
      res += Map[i][j] != 'R';
    }
  }
  for (int i = 1; i <= m; i++) {
    int res = 0;
    for (int j = n; j >= 1; j--) {
      D[j][i] = res;
      res += Map[j][i] != 'R';
    }
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    static int tmp[2005];
    for (int j = 1; j <= m; j++) tmp[j] = 0;
    if (i == 1) {
      for (int j = 1; j <= 1 + R[1][1]; j++) tmp[j] = 1;
    } else {
      for (int j = 1; j <= m; j++) calc(dp[i][j], dp[i - 1][j]);
      for (int j = 1; j <= m; j++)
        calc(tmp[j + 1], dp[i][j]), calc(tmp[j + R[i][j] + 1], P - dp[i][j]);
      for (int j = 1; j <= m; j++) calc(tmp[j], tmp[j - 1]);
    }
    for (int j = 1; j <= m; j++) {
      calc(dp[i + 1][j], tmp[j]);
      calc(dp[i + D[i][j] + 1][j], P - tmp[j]);
    }
    if (i == n) ans = (tmp[m] + dp[i][m]) % P;
  }
  cout << ans << endl;
  return 0;
}
