#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <typename T>
ostream &operator<<(ostream &out, const pair<T, T> &P) {
  out << P.first << ' ' << P.second;
  return out;
}
template <typename T>
ostream &operator<<(ostream &out, const vector<T> &V) {
  for (int i = 0; i < V.size(); ++i) out << V[i] << ' ';
  return out;
}
template <typename T>
istream &operator>>(istream &in, vector<T> &V) {
  for (T &i : V) in >> i;
  return in;
}
template <typename T>
istream &operator>>(istream &in, pair<T, T> &P) {
  in >> P.first >> P.second;
  return in;
}
const int mod = 1e9 + 7;
int n, m;
int RR[(2010)][(2010)], RD[(2010)][(2010)];
int suf[(2010)][(2010)][2];
int dp[(2010)][(2010)][2];
ll solve(int i, int j, bool vou) {
  if (i == n - 1 and j == m - 1) return dp[i][j][vou] = 1;
  int &s = dp[i][j][vou];
  s = 0;
  if (vou) {
    s = suf[i + 1][j][vou] - suf[n - RD[i][j]][j][vou];
    if (s < 0) s += mod;
    return s;
  } else {
    s = suf[i][j + 1][vou] - suf[i][m - RR[i][j]][vou];
    if (s < 0) s += mod;
    return s;
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> m;
  if (n == 1 and m == 1) {
    cout << "1\n";
    exit(0);
  }
  char mat[n][m];
  for (int i = int(0); i < int(n); i++)
    for (int j = int(0); j < int(m); j++) cin >> mat[i][j];
  memset(dp, 0, sizeof dp);
  for (int i = 0; i < n; i++) {
    int cnt = 0;
    for (int j = m - 1; j >= 0; --j) {
      RR[i][j] = cnt;
      if (mat[i][j] == 'R') cnt++;
    }
  }
  for (int j = 0; j < m; j++) {
    int cnt = 0;
    for (int i = n - 1; i >= 0; --i) {
      RD[i][j] = cnt;
      if (mat[i][j] == 'R') cnt++;
    }
  }
  memset(suf, 0, sizeof suf);
  for (int i = n - 1; i >= 0; --i) {
    for (int j = m - 1; j >= 0; --j) {
      suf[i][j][true] = suf[i + 1][j][true];
      suf[i][j][false] = suf[i][j + 1][false];
      solve(i, j, false);
      solve(i, j, true);
      suf[i][j][true] = (suf[i][j][true] + dp[i][j][false]) % mod;
      suf[i][j][false] = (suf[i][j][false] + dp[i][j][true]) % mod;
    }
  }
  if (0) {
    cout << "SUF: " << '\n';
    for (int i = int(0); i < int(n); i++) {
      for (int j = int(0); j < int(m); j++) {
        cout << suf[i][j][false] << ' ';
      }
      cout << '\n';
    }
    cout << "DP: \n";
    for (int i = int(0); i < int(n); i++) {
      for (int j = int(0); j < int(m); j++) {
        cout << dp[i][j][true] << ' ';
      }
      cout << '\n';
    }
  }
  cout << (dp[0][0][true] + dp[0][0][false]) % mod << '\n';
  return 0;
}
