#include <bits/stdc++.h>
using namespace std;
const int N = 2010, mod = 1e9 + 7;
int dp[N][N][2], sum[N][N][2], n, m, cnt[N][N][2];
char ch[N][N];
int main() {
  int i, j, tmp;
  scanf("%d%d", &n, &m);
  for (i = 1; i <= n; i++) scanf("%s", ch[i] + 1);
  for (i = 1; i <= n; i++)
    for (j = m; j >= 1; j--)
      cnt[i][j][1] = cnt[i][j + 1][1] + (ch[i][j] == '.');
  for (j = 1; j <= m; j++)
    for (i = n; i >= 1; i--)
      cnt[i][j][0] = cnt[i + 1][j][0] + (ch[i][j] == '.');
  if (ch[n][m] == 'R') cout << 0, exit(0);
  if (n == 1 && m == 1) cout << 1, exit(0);
  dp[n][m][0] = dp[n][m][1] = 1;
  sum[n][m][0] = sum[n][m][1] = 1;
  for (i = n; i >= 1; i--) {
    for (j = m; j >= 1; j--) {
      if (i == n && j == m) continue;
      tmp = cnt[i + 1][j][0];
      dp[i][j][0] = (sum[i + 1][j][1] - sum[i + tmp + 1][j][1] + mod) % mod;
      tmp = cnt[i][j + 1][1];
      dp[i][j][1] = (sum[i][j + 1][0] - sum[i][j + tmp + 1][0] + mod) % mod;
      sum[i][j][0] = (sum[i][j + 1][0] + dp[i][j][0]) % mod;
      sum[i][j][1] = (sum[i + 1][j][1] + dp[i][j][1]) % mod;
    }
  }
  cout << (dp[1][1][0] + dp[1][1][1]) % mod;
  return ~~(0 - 0);
}
