#include <bits/stdc++.h>
const int mod = 1000000007;
inline void add(int &v, int x) {
  v += x;
  if (v >= mod) v -= mod;
}
char s[2010][2010];
int a[2010][2010][2], dp[2010][2010][2], b[2010][2010][2];
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) {
    scanf("%s", s[i]);
  }
  for (int i = n - 1; i >= 0; i--) {
    for (int j = m - 1; j >= 0; j--) {
      a[i][j][0] = a[i + 1][j][0] + (s[i][j] == 'R');
      a[i][j][1] = a[i][j + 1][1] + (s[i][j] == 'R');
    }
  }
  if (n == 1) {
    printf("%d\n", !a[0][0][1]);
    return 0;
  }
  if (m == 1) {
    printf("%d\n", !a[0][0][0]);
    return 0;
  }
  for (int i = n - 1; i >= 0; i--) {
    for (int j = m - 1; j >= 0; j--) {
      if (i == n - 1) {
        dp[i][j][0] = dp[i][j][1] = !a[i][j][1];
      } else if (j == m - 1) {
        dp[i][j][0] = dp[i][j][1] = !a[i][j][0];
      } else {
        dp[i][j][0] = b[i][j + 1][1] - b[n - a[i][j][0]][j + 1][1];
        if (dp[i][j][0] < 0) dp[i][j][0] += mod;
        dp[i][j][1] = b[i + 1][j][0] - b[i + 1][m - a[i][j][1]][0];
        if (dp[i][j][1] < 0) dp[i][j][1] += mod;
      }
      b[i][j][0] = b[i][j + 1][0];
      add(b[i][j][0], dp[i][j][0]);
      b[i][j][1] = b[i + 1][j][1];
      add(b[i][j][1], dp[i][j][1]);
    }
  }
  printf("%d\n", dp[0][0][0]);
  return 0;
}
