#include <bits/stdc++.h>
using namespace std;
const long long N = 2019;
const long long mod = 1e9 + 7;
long long dp[2][N][N];
long long suffix[2][N][N];
long long rocksRow[N][N], rocksCol[N][N];
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, m;
  cin >> n >> m;
  vector<string> grid(n);
  long long totalRocks = 0;
  for (long long i = 0; i < n; ++i) {
    cin >> grid[i];
    for (long long j = 0; j < m; ++j) {
      if (grid[i][j] == 'R') ++totalRocks;
    }
  }
  if (grid[n - 1][m - 1] == 'R') {
    cout << 0;
    return 0;
  }
  if (n == 1 || m == 1) {
    if (totalRocks == 0)
      cout << 1;
    else
      cout << 0;
    return 0;
  }
  for (long long i = n - 1; i >= 0; --i) {
    for (long long j = m - 1; j >= 0; --j) {
      rocksRow[i][j] = (grid[i][j] == 'R') + rocksRow[i][j + 1];
    }
  }
  for (long long j = m - 1; j >= 0; --j) {
    for (long long i = n - 1; i >= 0; --i) {
      rocksCol[i][j] = (grid[i][j] == 'R') + rocksCol[i + 1][j];
    }
  }
  dp[0][n - 1][m - 1] = 1;
  dp[1][n - 1][m - 1] = 1;
  suffix[0][n - 1][m - 1] = 1;
  suffix[1][n - 1][m - 1] = 1;
  for (long long i = n - 1; i >= 0; --i) {
    for (long long j = m - 1; j >= 0; --j) {
      if (i == n - 1 && j == m - 1) continue;
      long long rocks = rocksRow[i][j + 1];
      long long free = m - j - 1 - rocks;
      dp[0][i][j] =
          (suffix[1][i][j + 1] - suffix[1][i][j + free + 1] + mod) % mod;
      rocks = rocksCol[i + 1][j];
      free = n - i - 1 - rocks;
      dp[1][i][j] =
          (suffix[0][i + 1][j] - suffix[0][i + free + 1][j] + mod) % mod;
      suffix[1][i][j] = (dp[1][i][j] + suffix[1][i][j + 1]) % mod;
      suffix[0][i][j] = (dp[0][i][j] + suffix[0][i + 1][j]) % mod;
    }
  }
  cout << (dp[0][0][0] + dp[1][0][0]) % mod;
}
