#include <bits/stdc++.h>
using namespace std;
int a[2004][2004], n, m;
int rowR[2004][2004], rowC[2004][2004];
long long dp[2004][2004];
long long temp[2004], diff[2004], s[2004];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    string x;
    cin >> x;
    for (int j = 1; j <= m; j++) a[i][j] = (x[j - 1] == 'R');
  }
  if (n == 1 && m == 1) {
    puts("1");
    return 0;
  }
  for (int i = 1; i <= n; i++) {
    for (int j = m; j >= 1; j--) {
      rowR[i][j] = (j == m ? 0 : rowR[i][j + 1] + a[i][j + 1]);
    }
  }
  for (int j = 1; j <= m; j++) {
    for (int i = n; i >= 1; i--) {
      rowC[i][j] = (i == n ? 0 : rowC[i + 1][j] + a[i + 1][j]);
    }
  }
  dp[1][1] = 1;
  dp[1][2] = 1000000007 - 1;
  for (int i = 1; i <= n; i++) temp[i] = s[i] = diff[i] = 0;
  for (int j = 1; j <= m; j++) {
    for (int i = 1; i <= n; i++) temp[i] = diff[i] = 0;
    for (int i = 1; i <= n; i++) s[i] = (s[i] + dp[i][j]) % 1000000007;
    for (int i = 1; i <= n; i++)
      if (s[i]) {
        int li = i + 1;
        int left = n;
        int rock = rowC[i][j];
        int ri = left - rock;
        if (li <= ri) {
          diff[li] = (diff[li] + s[i]) % 1000000007;
          diff[ri + 1] = (diff[ri + 1] - s[i] + 1000000007) % 1000000007;
        }
      }
    long long sum = 0;
    for (int i = 1; i <= n; i++) {
      sum = (sum + diff[i]) % 1000000007;
      temp[i] = sum;
      if (i == 1 && j == 1) temp[i] = 1;
      int li = j + 1;
      int left = m;
      int rock = rowR[i][j];
      int ri = left - rock;
      if (li <= ri) {
        dp[i][li] = (dp[i][li] + temp[i]) % 1000000007;
        dp[i][ri + 1] = (dp[i][ri + 1] - temp[i] + 1000000007) % 1000000007;
      }
    }
  }
  printf("%lld\n", (s[n] + temp[n]) % 1000000007);
}
