#include <bits/stdc++.h>
using namespace std;
const long long maxn = 2005;
const long long dd = (long long)(1e9) + 7;
long long n, m;
long long dp[maxn][maxn][2], sum[maxn][maxn][2], a[maxn][maxn],
    stp[maxn][maxn][2];
inline long long read() {
  long long ret = 0, f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -f;
    ch = getchar();
  }
  while (isdigit(ch)) {
    ret = ret * 10 + ch - '0';
    ch = getchar();
  }
  return ret * f;
}
void scan() {
  n = read();
  m = read();
  char ch = getchar();
  for (long long k = 1; k <= n; k++) {
    while (ch != '.' && ch != 'R') ch = getchar();
    long long j = 0;
    while (ch == '.' || ch == 'R') {
      a[k][++j] = (ch == 'R');
      ch = getchar();
    }
  }
}
void prework() {
  for (long long k = n; k; k--)
    for (long long j = m; j; j--)
      stp[k][j][0] = stp[k][j + 1][0] + a[k][j],
      stp[k][j][1] = stp[k + 1][j][1] + a[k][j];
  for (long long k = 1; k <= n; k++)
    for (long long j = 1; j <= m; j++)
      stp[k][j][0] = m - stp[k][j][0] + 1, stp[k][j][1] = n - stp[k][j][1] + 1;
}
void solve() {
  if (n == 1 && m == 1) {
    puts("1");
    return;
  }
  dp[n][m][0] = dp[n][m][1] = sum[n][m][0] = sum[n][m][1] = 1;
  for (long long k = n; k; k--)
    for (long long j = m; j; j--) {
      if (k == n && j == m) continue;
      dp[k][j][0] = (sum[k][j + 1][1] - sum[k][stp[k][j + 1][0]][1] + dd) % dd;
      dp[k][j][1] = (sum[k + 1][j][0] - sum[stp[k + 1][j][1]][j][0] + dd) % dd;
      sum[k][j][0] = (sum[k + 1][j][0] + dp[k][j][0]) % dd;
      sum[k][j][1] = (sum[k][j + 1][1] + dp[k][j][1]) % dd;
    }
  printf("%lld\n", (dp[1][1][0] + dp[1][1][1]) % dd);
}
signed main() {
  scan();
  prework();
  solve();
  return 0;
}
