#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  if (!b)
    return a;
  else
    return gcd(b, a % b);
}
inline void mod(int &x) {
  if (x >= (long long int)(1e9 + 7)) x -= (long long int)(1e9 + 7);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  vector<string> s(n);
  for (int i = 0; i < n; i++) cin >> s[i];
  vector<vector<int>> dp1(n, vector<int>(m)), dp2(n, vector<int>(m));
  if (n == 1 && m == 1) {
    cout << 1;
    return 0;
  }
  vector<vector<int>> row(n), col(m);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (s[i][j] == 'R') {
        row[i].push_back(j);
        col[j].push_back(i);
      }
    }
  }
  dp1[0][0] = dp2[0][0] = 1;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (i && i - 1 + j) dp1[i][j] += dp1[i - 1][j];
      if (j && i + j - 1) dp2[i][j] += dp2[i][j - 1];
      mod(dp1[i][j]);
      mod(dp2[i][j]);
      int p = upper_bound(row[i].begin(), row[i].end(), j) - row[i].begin();
      int rocks = (int)(row[i].size()) - p;
      if (m - 1 - j > rocks) {
        dp2[i][j + 1] += dp1[i][j];
        mod(dp2[i][j + 1]);
        if (rocks) {
          dp2[i][m - rocks] += (long long int)(1e9 + 7) - dp1[i][j];
          mod(dp2[i][m - rocks]);
        }
      }
      p = upper_bound(col[j].begin(), col[j].end(), i) - col[j].begin();
      rocks = (int)(col[j].size()) - p;
      if (n - 1 - i > rocks) {
        dp1[i + 1][j] += dp2[i][j];
        mod(dp1[i + 1][j]);
        if (rocks) {
          dp1[n - rocks][j] += (long long int)(1e9 + 7) - dp2[i][j];
          mod(dp1[n - rocks][j]);
        }
      }
    }
  }
  int ans = dp2[n - 1][m - 1] + dp1[n - 1][m - 1];
  cout << ans % (long long int)(1e9 + 7);
}
