#include <bits/stdc++.h>
using namespace std;
const int N = 2003, M = 1000000007;
int n, m, x1, x2, dw[N][N], rt[N], ds[N][N], rs[N];
char mp[N][N];
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", mp[i] + 1);
  for (int i = n; i; i--)
    for (int j = 1; j <= m; j++) ds[i - 1][j] = ds[i][j] + (mp[i][j] == 'R');
  dw[1][1] = 1, dw[2][1] = M - 1;
  for (int i = 1; i <= n; i++) {
    for (int j = m; j; j--) rs[j - 1] = rs[j] + (mp[i][j] == 'R'), rt[j] = 0;
    if (i == 1) rt[1] = 1, rt[2] = M - 1;
    for (int j = 1; j <= m; j++) {
      (dw[i][j] += dw[i - 1][j]) >= M ? dw[i][j] -= M : 0;
      (rt[j] += rt[j - 1]) >= M ? rt[j] -= M : 0;
      x1 = rt[j], x2 = dw[i][j];
      (dw[i + 1][j] += x1) >= M ? dw[i + 1][j] -= M : 0;
      (dw[n - ds[i][j] + 1][j] += M - x1) >= M ? dw[n - ds[i][j] + 1][j] -= M
                                               : 0;
      (rt[j + 1] += x2) >= M ? rt[j + 1] -= M : 0;
      (rt[m - rs[j] + 1] += M - x2) >= M ? rt[m - rs[j] + 1] -= M : 0;
    }
  }
  (x1 += x2) >= M ? x1 -= M : 0;
  printf("%d", x1);
}
