#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const double eps = 1e-6;
const int INF = 0x3f3f3f3f;
const int MAXN = 2e3 + 5;
const int MOD = 1e9 + 7;
int n, m;
long long dp[MAXN][MAXN][2];
long long sumdp[MAXN][MAXN][2];
int sum[MAXN][MAXN][2];
char s[MAXN];
int Binsearch(int i, int j, int v, int op) {
  if (op == 0) {
    int l = 1, r = n;
    while (l <= r) {
      int mid = (l + r) / 2;
      if (sum[mid][j][0] >= v) {
        r = mid - 1;
      } else {
        l = mid + 1;
      }
    }
    return l;
  } else {
    int l = 1, r = m;
    while (l <= r) {
      int mid = (l + r) / 2;
      if (sum[i][mid][1] >= v) {
        r = mid - 1;
      } else {
        l = mid + 1;
      }
    }
    return l;
  }
}
int main() {
  while (scanf("%d%d", &n, &m) != EOF) {
    memset(sum, 0, sizeof sum);
    memset(sumdp, 0, sizeof sumdp);
    for (int i = 1; i <= n; i++) {
      scanf("%s", s);
      for (int j = 0; j < m; j++) {
        sum[i][j + 1][0] = sum[i - 1][j + 1][0];
        sum[i][j + 1][1] = sum[i][j][1];
        if (s[j] == 'R') {
          sum[i][j + 1][0]++;
          sum[i][j + 1][1]++;
        }
      }
    }
    memset(dp, 0, sizeof dp);
    for (int i = 1; i <= n - sum[n][1][0]; i++)
      sumdp[i][1][1] = dp[i][1][0] = 1;
    for (int i = 1; i <= m - sum[1][m][1]; i++)
      sumdp[1][i][0] = dp[1][i][1] = 1;
    for (int i = 2; i <= n; i++)
      for (int j = 2; j <= m; j++) {
        int k = Binsearch(i, j, sum[n][j][0] - (n - i), 0);
        dp[i][j][0] = (sumdp[i - 1][j][0] - sumdp[k - 1][j][0] + MOD) % MOD;
        k = Binsearch(i, j, sum[i][m][1] - (m - j), 1);
        dp[i][j][1] = (sumdp[i][j - 1][1] - sumdp[i][k - 1][1] + MOD) % MOD;
        sumdp[i][j][0] = (sumdp[i - 1][j][0] + dp[i][j][1]) % MOD;
        sumdp[i][j][1] = (sumdp[i][j - 1][1] + dp[i][j][0]) % MOD;
      }
    if (n == 1 && m == 1 && sum[1][1][0] == 0)
      printf("%d\n", 1);
    else
      printf("%lld\n", (dp[n][m][1] + dp[n][m][0]) % MOD);
  }
  return 0;
}
