#include <bits/stdc++.h>
using namespace std;
const int N = 2020;
const int MOD = 1e9 + 7;
void add(int& a, int b) {
  a += b;
  if (a >= MOD) a -= MOD;
}
int sum(int a, int b) {
  a += b;
  if (a >= MOD) a -= MOD;
  return a;
}
int sub(int& a, int b) {
  a -= b;
  if (a < 0) a += MOD;
}
char s[N][N];
int dp[N][N][2];
int cnt[2][N][N];
int pref[2][N][N][2];
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; ++i) scanf("%s", s[i]);
  if (n == 1 && m == 1) {
    printf("1");
    return 0;
  }
  for (int i = 0; i < n; ++i) {
    cnt[0][i][m - 1] = 0;
    for (int j = m - 2; j >= 0; --j)
      cnt[0][i][j] = cnt[0][i][j + 1] + (s[i][j + 1] == 'R');
  }
  for (int j = 0; j < m; ++j) {
    cnt[1][j][n - 1] = 0;
    for (int i = n - 2; i >= 0; --i)
      cnt[1][j][i] = cnt[1][j][i + 1] + (s[i + 1][j] == 'R');
  }
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < m; ++j) cnt[0][i][j] = -cnt[0][i][j];
  for (int j = 0; j < m; ++j)
    for (int i = 0; i < n; ++i) cnt[1][j][i] = -cnt[1][j][i];
  dp[0][0][1] = 1;
  pref[0][0][0][1] = pref[1][0][0][1] = 1;
  dp[0][0][0] = 1;
  pref[0][0][0][0] = pref[1][0][0][0] = 1;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      if (!i && !j) continue;
      int it =
          lower_bound(cnt[0][i], cnt[0][i] + j + 1, -(m - j - 1)) - cnt[0][i];
      if (j > 0) add(dp[i][j][0], pref[0][i][j - 1][1]);
      if (it > 0) sub(dp[i][j][0], pref[0][i][it - 1][1]);
      it = lower_bound(cnt[1][j], cnt[1][j] + i + 1, -(n - i - 1)) - cnt[1][j];
      if (i > 0) add(dp[i][j][1], pref[1][i - 1][j][0]);
      if (it > 0) sub(dp[i][j][1], pref[1][it - 1][j][0]);
      for (int t = 0; t < 2; ++t) {
        pref[0][i][j][t] = dp[i][j][t];
        if (j > 0) add(pref[0][i][j][t], pref[0][i][j - 1][t]);
        pref[1][i][j][t] = dp[i][j][t];
        if (i > 0) add(pref[1][i][j][t], pref[1][i - 1][j][t]);
      }
    }
  }
  printf("%d", sum(dp[n - 1][m - 1][0], dp[n - 1][m - 1][1]));
}
