#include <bits/stdc++.h>
using namespace std;
const int N = 2005;
const int mod = 1e9 + 7;
int n, m;
char a[N][N];
int num[N][N][2], dp[N][N][2], sum[N][N][2];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%s", a[i] + 1);
  if (a[1][1] == 'R' || a[n][m] == 'R') {
    cout << "0" << endl;
    return 0;
  }
  if (n == 1 && m == 1) {
    cout << "1" << endl;
    return 0;
  }
  for (int i = n; i >= 1; i--) {
    for (int j = m; j >= 1; j--) {
      if (a[i][j] == 'R') num[i][j][0] = num[i][j][1] = 1;
      num[i][j][0] += num[i + 1][j][0];
      num[i][j][1] += num[i][j + 1][1];
    }
  }
  dp[n][m][0] = dp[n][m][1] = sum[n][m][0] = sum[n][m][1] = 1;
  for (int i = n; i >= 1; i--) {
    for (int j = m; j >= 1; j--) {
      if (i == n && j == m) continue;
      dp[i][j][0] =
          ((sum[i + 1][j][0] - sum[n - num[i + 1][j][0] + 1][j][0]) % mod +
           mod) %
          mod;
      dp[i][j][1] =
          ((sum[i][j + 1][1] - sum[i][m - num[i][j + 1][1] + 1][1]) % mod +
           mod) %
          mod;
      sum[i][j][0] = (sum[i + 1][j][0] + dp[i][j][1]) % mod;
      sum[i][j][1] = (sum[i][j + 1][1] + dp[i][j][0]) % mod;
    }
  }
  printf("%d", (dp[1][1][0] + dp[1][1][1]) % mod);
}
