#include <bits/stdc++.h>
using namespace std;
const int maxn = 2003, mod = 1000000007;
int Plus(int x, int y) { return (x += y) >= mod ? x - mod : x; }
void PlusEqual(int &x, int y) {
  if ((x += y) >= mod) x -= mod;
}
int Minus(int x, int y) { return Plus(x, mod - y); }
int mul(long long x, int y) { return x * y % mod; }
int n, m, dp[maxn][maxn][2], sumr[maxn][maxn], sumc[maxn][maxn],
    totr[maxn][maxn], totc[maxn][maxn];
char s[maxn][maxn];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%s", s[i] + 1);
    for (int j = 1; j <= m; j++) s[i][j] = (s[i][j] == 'R');
  }
  if (n == 1 && m == 1) {
    printf("%d\n", !s[1][1]);
    return 0;
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      sumr[i][j] = sumr[i][j - 1] + s[i][j];
      sumc[i][j] = sumc[i - 1][j] + s[i][j];
    }
  }
  dp[1][1][0] = dp[1][1][1] = totr[1][1] = totc[1][1] = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (i > 1 || j > 1) {
        totr[i][j] = totr[i][j - 1];
        totc[i][j] = totc[i - 1][j];
      }
      if (j > 1) {
        int l = 1, r = j - 1, mid, ans = j;
        while (l <= r) {
          mid = (l + r) >> 1;
          if (sumr[i][m] - sumr[i][mid] <= m - j)
            ans = mid, r = mid - 1;
          else
            l = mid + 1;
        }
        dp[i][j][0] = Minus(totr[i][j - 1], totr[i][ans - 1]);
        PlusEqual(totc[i][j], dp[i][j][0]);
      }
      if (i > 1) {
        int l = 1, r = i - 1, mid, ans = i;
        while (l <= r) {
          mid = (l + r) >> 1;
          if (sumc[n][j] - sumc[mid][j] <= n - i)
            ans = mid, r = mid - 1;
          else
            l = mid + 1;
        }
        dp[i][j][1] = Minus(totc[i - 1][j], totc[ans - 1][j]);
        PlusEqual(totr[i][j], dp[i][j][1]);
      }
    }
  }
  printf("%d\n", Plus(dp[n][m][0], dp[n][m][1]));
  return 0;
}
