#include <bits/stdc++.h>
using namespace std;
long long int read() {
  long long int x = 0, f = 1ll;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
  return f * x;
}
int n, m;
char s[2005][2005];
long long int sum1[2005][2005], sum2[2005][2005], dp[2005][2005][2],
    dp1[2005][2005], dp2[2005][2005];
int main() {
  n = read();
  m = read();
  for (int i = 1; i <= n; i++) scanf("%s", s[i] + 1);
  if (n == 1 && m == 1) {
    if (s[1][1] == '.')
      printf("1\n");
    else
      printf("0\n");
    return 0;
  }
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) sum1[i][j] = sum1[i][j - 1] + (s[i][j] == 'R');
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) sum2[i][j] = sum2[i - 1][j] + (s[i][j] == 'R');
  dp[1][1][0] = dp[1][1][1] = dp1[1][1] = dp2[1][1] = 1;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      int l = 1, r = i - 1, x = -1, y = -1;
      int ddd = n - i - (sum2[n][j] - sum2[i][j]);
      while (l <= r) {
        int mid = (l + r) >> 1;
        if (sum2[i][j] - sum2[mid][j] <= ddd) {
          x = mid;
          r = mid - 1;
        } else
          l = mid + 1;
      }
      ddd = m - j - (sum1[i][m] - sum1[i][j]);
      l = 1, r = j - 1;
      while (l <= r) {
        int mid = (l + r) >> 1;
        if (sum1[i][j] - sum1[i][mid] <= ddd) {
          y = mid;
          r = mid - 1;
        } else
          l = mid + 1;
      }
      if (x != -1)
        dp[i][j][0] =
            (dp[i][j][0] + (dp2[i - 1][j] - dp2[x - 1][j]) % 1000000007 +
             1000000007) %
            1000000007;
      if (y != -1)
        dp[i][j][1] =
            (dp[i][j][1] + (dp1[i][j - 1] - dp1[i][y - 1]) % 1000000007 +
             1000000007) %
            1000000007;
      dp1[i][j] = (dp1[i][j - 1] + dp[i][j][0]) % 1000000007;
      dp2[i][j] = (dp2[i - 1][j] + dp[i][j][1]) % 1000000007;
    }
  printf("%lld\n", (dp[n][m][0] + dp[n][m][1]) % 1000000007);
  return 0;
}
