#include <bits/stdc++.h>
using namespace std;
const int maxn = 2050;
const int mod = 1e9 + 7;
char s[maxn][maxn];
int sum[maxn][maxn][2], f[maxn][maxn][2], num[maxn][maxn][2];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%s", s[i] + 1);
  }
  if (n == 1 && m == 1) {
    printf("1\n");
    return 0;
  }
  for (int i = n; i >= 1; i--) {
    for (int j = m; j >= 1; j--) {
      num[i][j][0] = num[i][j + 1][0];
      num[i][j][1] = num[i + 1][j][1];
      if (s[i][j] == 'R') {
        num[i][j][0]++;
        num[i][j][1]++;
      }
    }
  }
  f[n][m][0] = f[n][m][1] = 1;
  sum[n][m][0] = sum[n][m][1] = 1;
  for (int i = n; i >= 1; i--) {
    for (int j = m; j >= 1; j--) {
      if (i == n && j == m) continue;
      f[i][j][0] = ((long long)sum[i][j + 1][0] -
                    sum[i][m - num[i][j + 1][0] + 1][0] + mod) %
                   mod;
      f[i][j][1] = ((long long)sum[i + 1][j][1] -
                    sum[n - num[i + 1][j][1] + 1][j][1] + mod) %
                   mod;
      sum[i][j][0] = ((long long)sum[i][j + 1][0] + f[i][j][1]) % mod;
      sum[i][j][1] = ((long long)sum[i + 1][j][1] + f[i][j][0]) % mod;
    }
  }
  printf("%d\n", ((long long)f[1][1][0] + f[1][1][1]) % mod);
  return 0;
}
