#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2005;
const int MOD = 1000000007;
int n, m;
char Map[MAXN][MAXN];
long long dp[MAXN][MAXN][2];
int sum[MAXN][MAXN][2], rock[MAXN][MAXN][2];
int main() {
  cin >> n >> m;
  if (n == 1 && m == 1) {
    cout << "1" << endl;
    return 0;
  }
  for (int i = 1; i <= n; ++i) cin >> Map[i] + 1;
  dp[1][1][1] = dp[1][1][0] = 1;
  sum[1][1][1] = sum[1][1][0] = 1;
  for (int i = 1; i <= n; ++i)
    for (int j = m; j >= 1; --j)
      rock[i][j][0] = rock[i][j + 1][0] + (Map[i][j + 1] == 'R' ? 1 : 0);
  for (int i = n; i >= 1; --i)
    for (int j = 1; j <= m; ++j)
      rock[i][j][1] = rock[i + 1][j][1] + (Map[i + 1][j] == 'R' ? 1 : 0);
  int l, r, mid;
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j) {
      if (i == 1 && j == 1) continue;
      l = 0, r = j;
      while (l < r) {
        mid = l + r >> 1;
        if (rock[i][mid][0] <= m - j)
          r = mid;
        else
          l = mid + 1;
      }
      if (l < j)
        dp[i][j][0] =
            (dp[i][j][0] +
             (sum[i][j - 1][0] - ((l == 0) ? 0 : sum[i][l - 1][0])) + MOD) %
            MOD;
      l = 0, r = i;
      while (l < r) {
        mid = l + r >> 1;
        if (rock[mid][j][1] <= n - i)
          r = mid;
        else
          l = mid + 1;
      }
      if (l < i)
        dp[i][j][1] =
            (dp[i][j][1] +
             (sum[i - 1][j][1] - ((l == 0) ? 0 : sum[l - 1][j][1])) + MOD) %
            MOD;
      sum[i][j][0] = (sum[i][j - 1][0] + dp[i][j][1]) % MOD;
      sum[i][j][1] = (sum[i - 1][j][1] + dp[i][j][0]) % MOD;
    }
  cout << (dp[n][m][0] + dp[n][m][1]) % MOD << endl;
  return 0;
}
