#include <bits/stdc++.h>
using namespace std;
const int N = 2005;
const long long mod = 1e9 + 7;
long long R[N][N] = {}, D[N][N] = {};
int sr[N][N] = {}, sd[N][N] = {};
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int n, m;
  char ch;
  cin >> n >> m;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      cin >> ch;
      if (ch == 'R') sr[i][j] = sd[i][j] = 1;
    }
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      sr[i][j] += sr[i][j - 1];
      sd[i][j] += sd[i - 1][j];
    }
  if (n == 1 && m == 1) {
    cout << "1\n";
    return 0;
  }
  R[1][1] = D[1][1] = 1;
  R[1][2] = D[2][1] = -1;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      R[i][j] = (R[i][j - 1] + R[i][j]) % mod;
      D[i][j] = (D[i - 1][j] + D[i][j]) % mod;
      int dk = sd[n][j] - sd[i][j], rk = sr[i][m] - sr[i][j];
      R[i][j + 1] += D[i][j], R[i][m - rk + 1] -= D[i][j];
      D[i + 1][j] += R[i][j], D[n - dk + 1][j] -= R[i][j];
    }
  cout << ((R[n][m] + D[n][m]) % mod + mod) % mod << '\n';
  return 0;
}
