#include <bits/stdc++.h>
using namespace std;
const long long oo = 2002;
const long long tjj = 1e9 + 7;
long long n, m;
long long dp[oo][oo][2];
long long ma[oo][oo][2];
char p[oo][oo];
signed main() {
  scanf("%lld%lld", &n, &m);
  for (register long long i = 1; i <= n; i++) scanf("%s", p[i] + 1);
  if (n == 1 && n == m && p[1][1] == '.') {
    puts("1");
    return 0;
  }
  for (register long long i = n; i >= 1; i--) {
    for (register long long j = m; j >= 1; j--) {
      ma[i][j][0] = ma[i][j + 1][0] + (p[i][j] == 'R');
      ma[i][j][1] = ma[i + 1][j][1] + (p[i][j] == 'R');
    }
  }
  for (register long long i = n - 1; i >= 1; i--)
    if (ma[i][m][1] == 0) dp[i][m][1] = 1;
  for (register long long i = m - 1; i >= 1; i--)
    if (ma[n][i][0] == 0) dp[n][i][0] = 1;
  for (register long long i = n - 1; i >= 1; i--) {
    for (register long long j = m - 1; j >= 1; j--) {
      (dp[i][j][0] += dp[i][j + 1][1]) %= tjj;
      (dp[i][j][1] += dp[i + 1][j][0]) %= tjj;
      if (p[i + 1][j] == 'R')
        (dp[i][j][1] +=
         (dp[i + 1][j][1] - dp[n - ma[i + 1][j][1] + 1][j][0] + tjj)) %= tjj;
      else
        (dp[i][j][1] += dp[i + 1][j][1]) %= tjj;
      if (p[i][j + 1] == 'R')
        (dp[i][j][0] +=
         (dp[i][j + 1][0] - dp[i][m - ma[i][j + 1][0] + 1][1] + tjj)) %= tjj;
      else
        (dp[i][j][0] += dp[i][j + 1][0]) %= tjj;
    }
  }
  printf("%lld", (dp[1][1][1] + dp[1][1][0]) % tjj);
  return 0;
}
