#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int n, m;
int a[2005][2005];
int rig[2005][2005], dow[2005][2005];
long long r[2005][2005], d[2005][2005], sumr[2005][2005], sumd[2005][2005];
char s[2005];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) {
    scanf("%s", s + 1);
    for (int j = 1; j <= m; ++j)
      if (s[j] == 'R') a[i][j] = 1;
  }
  sumd[n][m] = sumr[n][m] = r[n][m] = d[n][m] = 1;
  if (n == 1 && m == 1) {
    puts("1");
    return 0;
  }
  for (int i = n; i >= 1; --i)
    for (int j = 1; j <= m; ++j) dow[i][j] = dow[i + 1][j] + a[i][j];
  for (int i = 1; i <= n; ++i)
    for (int j = m; j >= 1; --j) rig[i][j] = rig[i][j + 1] + a[i][j];
  for (int i = n; i >= 1; --i)
    for (int j = m; j >= 1; --j) {
      if (i == n && j == m) continue;
      d[i][j] = (sumr[i + 1][j] - sumr[n - dow[i + 1][j] + 1][j]) % mod;
      r[i][j] = (sumd[i][j + 1] - sumd[i][m - rig[i][j + 1] + 1]) % mod;
      sumd[i][j] = (sumd[i][j + 1] + d[i][j]) % mod;
      sumr[i][j] = (sumr[i + 1][j] + r[i][j]) % mod;
    }
  printf("%lld\n", ((r[1][1] + d[1][1]) % mod + mod) % mod);
}
