#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int maxd = 2e3 + 10;
int n, m;
char s[maxd][maxd];
int a[maxd][maxd], b[maxd][maxd];
int fx[maxd][maxd], fy[maxd][maxd];
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%s", s[i] + 1);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) a[i][j] = b[i][j] = (s[i][j] == 'R');
  for (int i = n; i >= 1; i--)
    for (int j = m; j >= 1; j--) {
      b[i][j] += b[i][j + 1];
      a[i][j] += a[i + 1][j];
    }
  for (int i = 1; i < m; i++)
    if (!b[n][i]) fy[n][i] = 1;
  for (int i = 1; i < n; i++)
    if (!a[i][m]) fx[i][m] = 1;
  for (int i = n - 1; i; i--)
    for (int j = m - 1; j; j--) {
      fx[i][j] = (fx[i + 1][j] + fy[i + 1][j]) % mod;
      if (s[i + 1][j] == 'R')
        fx[i][j] = (fx[i][j] - fy[n - a[i + 1][j] + 1][j] + mod) % mod;
      fy[i][j] = (fx[i][j + 1] + fy[i][j + 1]) % mod;
      if (s[i][j + 1] == 'R')
        fy[i][j] = (fy[i][j] - fx[i][m - b[i][j + 1] + 1] + mod) % mod;
    }
  long long ans;
  if (n == 1 && m == 1 && s[1][1] == '.')
    ans = 1ll;
  else
    ans = (1ll * fx[1][1] + fy[1][1]) % mod;
  printf("%lld", ans);
  return 0;
}
