#include <bits/stdc++.h>
using namespace std;
const int maxN = 2005, mod = 1e9 + 7;
int f[maxN + 1][maxN + 1][2];
int n, m, s1[maxN + 1][maxN + 1], s2[maxN + 1][maxN + 1];
int t1[maxN + 1][maxN + 1], t2[maxN + 1][maxN + 1];
int h1[maxN + 1], h2[maxN + 1];
char G[maxN + 1][maxN + 1];
int main() {
  scanf("%d %d", &n, &m);
  if (n == 1 && m == 1) {
    puts("1");
    return 0;
  }
  for (int i = 1; i <= n; i++) scanf("%s", G[i] + 1);
  for (int i = 1; i <= n; i++)
    for (int j = m; j >= 1; j--) s1[i][j] = s1[i][j + 1] + (G[i][j + 1] == 'R');
  for (int j = 1; j <= m; j++)
    for (int i = n; i >= 1; i--) s2[i][j] = s2[i + 1][j] + (G[i + 1][j] == 'R');
  for (int i = 1; i <= n; i++) h1[i] = 1;
  for (int i = 1; i <= m; i++) h2[i] = 1;
  f[1][1][0] = f[1][1][1] = t1[1][1] = t2[1][1] = 1;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      if (i == 1 && j == 1) continue;
      while (s1[i][h1[i]] > m - j && h1[i] <= m) h1[i]++;
      if (h1[i] < j) f[i][j][0] = (t1[i][j - 1] - t1[i][h1[i] - 1]) % mod;
      while (s2[h2[j]][j] > n - i && h2[j] <= n) h2[j]++;
      if (h2[j] < i) f[i][j][1] = (t2[i - 1][j] - t2[h2[j] - 1][j]) % mod;
      t1[i][j] = (t1[i][j - 1] + f[i][j][1]) % mod;
      t2[i][j] = (t2[i - 1][j] + f[i][j][0]) % mod;
    }
  printf("%d", ((f[n][m][0] + f[n][m][1]) % mod + mod) % mod);
  return 0;
}
