#include <bits/stdc++.h>
using namespace std;
int val[2][2005][2005];
int dp[2][2005][2005];
string s;
int n, m;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    cin >> s;
    for (int j = 1; j <= m; j++)
      if (s[j - 1] == 'R') val[0][i][j] = val[1][i][j] = 1;
  }
  if (n == m && n == 1) return cout << 1 << '\n', 0;
  for (int i = 1; i <= n; i++)
    for (int j = m - 1; j >= 1; j--) val[0][i][j] += val[0][i][j + 1];
  for (int j = 1; j <= m; j++)
    for (int i = n - 1; i >= 1; i--) val[1][i][j] += val[1][i + 1][j];
  for (int i = 1; i < n; i++)
    if (val[1][i][m] == 0) dp[1][i][m] = 1;
  for (int j = 1; j < m; j++)
    if (val[0][n][j] == 0) dp[0][n][j] = 1;
  for (int i = n - 1; i >= 1; i--) {
    for (int j = m - 1; j >= 1; j--) {
      if (i == n && j == m) continue;
      int r = m;
      int l = j + 1;
      r = min(r, m - val[0][i][j + 1]);
      if (l <= r)
        dp[0][i][j] = (dp[1][i][l] - dp[1][i][r + 1] + 1000000007) % 1000000007;
      l = i + 1, r = n;
      r = min(r, n - val[1][i + 1][j]);
      if (l <= r)
        dp[1][i][j] = (dp[0][l][j] - dp[0][r + 1][j] + 1000000007) % 1000000007;
      dp[0][i][j] = (dp[0][i][j] + dp[0][i + 1][j]) % 1000000007;
      dp[1][i][j] = (dp[1][i][j] + dp[1][i][j + 1]) % 1000000007;
    }
  }
  int ans = (dp[0][1][1] - dp[0][2][1] + 1000000007) % 1000000007;
  int ans1 = (dp[1][1][1] - dp[1][1][2] + 1000000007) % 1000000007;
  cout << ((ans + ans1) % 1000000007) % 1000000007 << '\n';
  return 0;
}
