#include <bits/stdc++.h>
using namespace std;
using ull = unsigned long long;
using ll = long long;
const int N = 2005, MOD = 1e9 + 7;
int n, m, dp[N][N], dpr[N][N], rw[N][N], cl[N][N], pd[N][N], pr[N][N];
char mp[N][N];
void upd(int &a, int b) {
  a += b;
  if (a >= MOD) a -= MOD;
}
int getr(int j, int l, int r) {
  if (l > r) return 0;
  return (pr[j][l] - pr[j][r + 1] + MOD) % MOD;
}
int getd(int i, int l, int r) {
  if (l > r) return 0;
  return (pd[i][l] - pd[i][r + 1] + MOD) % MOD;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  cin >> n >> m;
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) {
      cin >> mp[i][j];
      rw[i][j] = rw[i][j - 1] + (mp[i][j] == 'R');
      cl[j][i] = cl[j][i - 1] + (mp[i][j] == 'R');
    }
  }
  if (n == 1 && m == 1) {
    cout << 1 << '\n';
    return 0;
  }
  pd[n][m] = 1;
  pr[m][n] = 1;
  for (int i = n; i > 0; --i) {
    for (int j = m; j > 0; --j) {
      dp[i][j] = getr(j, i + 1, n - (cl[j][n] - cl[j][i]));
      upd(pd[i][j], pd[i][j + 1]);
      upd(pd[i][j], dp[i][j]);
      dpr[i][j] = getd(i, j + 1, m - (rw[i][m] - rw[i][j]));
    }
    for (int j = 1; j <= m; ++j) {
      upd(pr[j][i], pr[j][i + 1]);
      upd(pr[j][i], dpr[i][j]);
    }
  }
  cout << (dp[1][1] + dpr[1][1]) % MOD << '\n';
  return 0;
}
