#include <bits/stdc++.h>
const int MAXN = 2005;
const int P = 1e9 + 7;
int n, m;
char a[MAXN][MAXN];
int r[MAXN][MAXN], c[MAXN][MAXN];
int f[MAXN][MAXN], g[MAXN][MAXN];
int main() {
  scanf("%d%d", &n, &m);
  if (n == 1 && m == 1) return puts("1"), 0;
  for (int i = 1; i <= n; i++) scanf("%s", a[i] + 1);
  for (int i = n; i >= 1; i--)
    for (int j = m; j >= 1; j--) {
      r[i][j] = r[i][j + 1] + (a[i][j] == 'R');
      c[i][j] = c[i + 1][j] + (a[i][j] == 'R');
      if (i == n && j == m)
        f[i][j] = g[i][j] = 1;
      else {
        f[i][j] =
            (1ll * P + f[i + 1][j] + g[i][j + 1] - g[i][m - r[i][j + 1] + 1]) %
            P;
        g[i][j] =
            (1ll * P + g[i][j + 1] + f[i + 1][j] - f[n - c[i + 1][j] + 1][j]) %
            P;
      }
    }
  printf("%lld\n", (2ll * P + f[1][1] - f[2][1] + g[1][1] - g[1][2]) % P);
  return 0;
}
