#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
int N, M;
char data[2003][2003];
int cntz[2003][2003], cnts[2003][2003];
long long dp[2003][2003][2], sum[2003][2003][2];
int main() {
  scanf("%d %d", &N, &M);
  for (int i = 1; i <= N; ++i) scanf("%s", data[i] + 1);
  for (int i = 1; i <= N; ++i) {
    cntz[i][0] = 0;
    for (int j = 1; j <= M; ++j) {
      cntz[i][j] = cntz[i][j - 1];
      if (data[i][j] == 'R') ++cntz[i][j];
    }
  }
  for (int j = 1; j <= M; ++j) {
    cnts[j][0] = 0;
    for (int i = 1; i <= N; ++i) {
      cnts[j][i] = cnts[j][i - 1];
      if (data[i][j] == 'R') ++cnts[j][i];
    }
  }
  dp[1][1][0] = dp[1][1][1] = 1;
  sum[1][1][0] = sum[1][1][1] = 1;
  for (int i = 1; i <= N; ++i)
    for (int j = 1; j <= M; ++j)
      if (i != 1 || j != 1) {
        int p = lower_bound(cntz[i] + 1, cntz[i] + M + 1, cntz[i][M] + j - M) -
                cntz[i];
        dp[i][j][0] = (sum[i][j - 1][1] + mod - sum[i][p - 1][1]) % mod;
        sum[i][j][0] = (sum[i - 1][j][0] + dp[i][j][0]) % mod;
        p = lower_bound(cnts[j] + 1, cnts[j] + N + 1, cnts[j][N] + i - N) -
            cnts[j];
        dp[i][j][1] = (sum[i - 1][j][0] + mod - sum[p - 1][j][0]) % mod;
        sum[i][j][1] = (sum[i][j - 1][1] + dp[i][j][1]) % mod;
      }
  dp[1][1][0] = 0;
  printf("%lld\n", (dp[N][M][0] + dp[N][M][1]) % mod);
  return 0;
}
