#include <bits/stdc++.h>
using namespace std;
const long long MD = 1e9 + 7;
int n, m, a[2005][2005];
deque<int> ro[2005], co[2005];
long long dp[2005][2005][2], sumr[2005], sumc[2005];
string str;
void dodp() {
  str = "";
  for (int i = n; i >= 1; i--) {
    for (int j = m; j >= 1; j--) {
      if (i == n and j == m) {
        dp[i][j][0] = 1;
        dp[i][j][1] = 1;
        sumr[i] = 1;
        sumc[j] = 1;
        ro[i].push_back(dp[i][j][0]);
        co[j].push_back(dp[i][j][1]);
        continue;
      }
      if (i != n) {
        if (a[i + 1][j] and !co[j].empty()) {
          sumc[j] -= co[j].back();
          sumc[j] %= MD;
          sumc[j] += MD;
          sumc[j] %= MD;
          co[j].pop_back();
        }
        dp[i][j][0] = sumc[j];
        ro[i].push_front(dp[i][j][0]);
        sumr[i] += dp[i][j][0];
        sumr[i] %= MD;
      }
      if (j != m) {
        if (a[i][j + 1] and !ro[i].empty()) {
          sumr[i] -= ro[i].back();
          sumr[i] %= MD;
          sumr[i] += MD;
          sumr[i] %= MD;
          ro[i].pop_back();
        }
        dp[i][j][1] = (((sumr[i] - dp[i][j][0]) % MD) + MD) % MD;
        co[j].push_front(dp[i][j][1]);
        sumc[j] += dp[i][j][1];
        sumc[j] %= MD;
      }
    }
  }
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> str;
    for (int j = 0; j < m; j++) a[i + 1][j + 1] = (str[j] == 'R');
  }
  if (n == 1 and m == 1) {
    cout << 1 << '\n';
    return 0;
  }
  dodp();
  cout << (dp[1][1][0] + dp[1][1][1]) % MD << '\n';
}
