#include <bits/stdc++.h>
using namespace std;
const int N = 2010;
const int mod = 1e9 + 7;
int dp[N][N][2], sum[N][N][2], R[N][N][2];
char s[N][N];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  if (n == 1 && m == 1) {
    puts("1");
    return 0;
  }
  for (int i = 0; i < n; i++) {
    scanf("%s", s[i]);
    for (int j = 0; s[i][j]; j++)
      if (s[i][j] == 'R') R[i][j][0] = R[i][j][1] = 1;
  }
  for (int i = 0; i < n; i++)
    for (int j = 1; j < m; j++) R[i][j][0] += R[i][j - 1][0];
  for (int i = 0; i < m; i++)
    for (int j = 1; j < n; j++) R[j][i][1] += R[j - 1][i][1];
  sum[0][0][0] = sum[0][0][0] = 1;
  dp[0][0][0] = dp[0][0][1] = 1;
  for (int i = 1; i < n; i++) {
    if (R[n - 1][0][1] <= n - i - 1) dp[i][0][1] += dp[i - 1][0][1];
    sum[i][0][0] = dp[i][0][1];
  }
  for (int i = 1; i < m; i++) {
    if (R[0][m - 1][0] <= m - i - 1) dp[0][i][0] += dp[0][i - 1][0];
    sum[0][i][1] = dp[0][i][0];
  }
  for (int i = 1; i < n; i++)
    for (int j = 1; j < m; j++) {
      int l = 0, r = i - 1, mid, t, res = -1;
      while (l <= r) {
        mid = l + r >> 1;
        t = R[n - 1][j][1] - R[mid][j][1];
        if (t <= n - i - 1)
          res = mid, r = mid - 1;
        else
          l = mid + 1;
      }
      if (res >= 0) {
        int tmp = res == 0 ? 0 : sum[res - 1][j][1];
        dp[i][j][1] = (sum[i - 1][j][1] - tmp + mod) % mod;
      }
      sum[i][j][0] = (sum[i][j - 1][0] + dp[i][j][1]) % mod;
      l = 0, r = j - 1, res = -1;
      while (l <= r) {
        mid = l + r >> 1;
        t = R[i][m - 1][0] - R[i][mid][0];
        if (t <= m - j - 1)
          res = mid, r = mid - 1;
        else
          l = mid + 1;
      }
      if (res >= 0) {
        int tmp = res == 0 ? 0 : sum[i][res - 1][0];
        dp[i][j][0] = (sum[i][j - 1][0] - tmp + mod) % mod;
      }
      sum[i][j][1] = (sum[i - 1][j][1] + dp[i][j][0]) % mod;
    }
  printf("%d\n", (dp[n - 1][m - 1][0] + dp[n - 1][m - 1][1]) % mod);
}
