#include <bits/stdc++.h>
using namespace std;
long long n, m, r[2100][2100], d[2100][2100], ds[2100][2100], rs[2100][2100];
long long sumr[2100][2100], sumd[2100][2100];
const int mod = 1e9 + 7;
char s[2100];
int main() {
  scanf("%d%d", &n, &m);
  for (register int i = 1; i <= n; i++) {
    scanf("%s", s + 1);
    for (register int j = 1; j <= m; j++) {
      if (s[j] == 'R') rs[i][j] = 1, ds[i][j] = 1;
    }
  }
  if (n == 1 && m == 1) {
    cout << (rs[1][1] ^ 1);
    return 0;
  }
  for (register int i = n; i >= 1; i--) {
    for (register int j = m; j >= 1; j--) {
      ds[i][j] += ds[i][j + 1];
      rs[i][j] += rs[i + 1][j];
    }
  }
  r[n][m] = d[n][m] = sumd[n][m] = sumr[n][m] = 1;
  for (register int i = n; i >= 1; i--) {
    for (register int j = m; j >= 1; j--) {
      if (i == n && j == m) continue;
      r[i][j] = (sumd[i][j + 1] - sumd[i][m - ds[i][j + 1] + 1]) % mod;
      d[i][j] = (sumr[i + 1][j] - sumr[n - rs[i + 1][j] + 1][j]) % mod;
      sumr[i][j] = (sumr[i + 1][j] + r[i][j]) % mod;
      sumd[i][j] = (sumd[i][j + 1] + d[i][j]) % mod;
    }
  }
  cout << ((r[1][1] + d[1][1]) % mod + mod) % mod;
  return 0;
}
