#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
long long MOD = 1000000007;
long double EPS = 1e-9;
long long binpow(long long b, long long p, long long mod) {
  long long ans = 1;
  b %= mod;
  for (; p; p >>= 1) {
    if (p & 1) ans = ans * b % mod;
    b = b * b % mod;
  }
  return ans;
}
void pre() {}
template <int MOD>
struct mod_int {
  static const int mod = MOD;
  unsigned x;
  mod_int() : x(0) {}
  mod_int(int sig) {
    int sigt = sig % MOD;
    if (sigt < 0) sigt += MOD;
    x = sigt;
  }
  mod_int(long long sig) {
    int sigt = sig % MOD;
    if (sigt < 0) sigt += MOD;
    x = sigt;
  }
  int get() const { return (int)x; }
  mod_int& operator+=(mod_int that) {
    if ((x += that.x) >= MOD) x -= MOD;
    return *this;
  }
  mod_int& operator-=(mod_int that) {
    if ((x += MOD - that.x) >= MOD) x -= MOD;
    return *this;
  }
  mod_int& operator*=(mod_int that) {
    x = (unsigned long long)x * that.x % MOD;
    return *this;
  }
  mod_int& operator/=(mod_int that) { return *this *= that.inverse(); }
  mod_int operator+(mod_int that) const { return mod_int(*this) += that; }
  mod_int operator-(mod_int that) const { return mod_int(*this) -= that; }
  mod_int operator*(mod_int that) const { return mod_int(*this) *= that; }
  mod_int operator/(mod_int that) const { return mod_int(*this) /= that; }
  mod_int inverse() const {
    long long a = x, b = MOD, u = 1, v = 0;
    while (b) {
      long long t = a / b;
      a -= t * b;
      swap(a, b);
      u -= t * v;
      swap(u, v);
    }
    return mod_int(u);
  }
};
template <int MOD>
istream& operator>>(istream& is, mod_int<MOD>& val) {
  long long x;
  is >> x;
  val = x;
  return is;
}
template <int MOD>
ostream& operator<<(ostream& os, const mod_int<MOD>& val) {
  os << val.get();
  return os;
}
using mint = mod_int<1000000007>;
template <typename T>
T binpow(T b, long long k) {
  T ans = T(1);
  for (; k; k >>= 1) {
    if (k & 1) ans = ans * b;
    b = b * b;
  }
  return ans;
}
int n, m;
vector<string> arr;
mint dp[2020][2020][2];
mint delta[2020][2020][2];
int rowcnt[2020][2020];
int colcnt[2020][2020];
void solve() {
  cin >> n >> m;
  arr.resize(n);
  for (long long i = 0; i < (n); ++i) cin >> arr[i];
  for (long long i = 0; i < (n); ++i)
    for (long long j = 0; j < (m); ++j) {
      if (arr[i][j] == 'R') {
        rowcnt[i][j] = 1;
        colcnt[i][j] = 1;
      }
    }
  for (long long i = n - 1; i >= 0; i--) {
    for (long long j = m - 1; j >= 0; j--) {
      colcnt[i][j] += colcnt[i][j + 1];
      rowcnt[i][j] += rowcnt[i + 1][j];
    }
  }
  if (n == 1 & m == 1) {
    cout << 1 << '\n';
    return;
  }
  dp[0][0][0] = 1;
  dp[0][0][1] = 1;
  for (long long i = 0; i < (n); ++i)
    for (long long j = 0; j < (m); ++j) {
      dp[i][j][0] += delta[i][j][0];
      delta[i][j + 1][0] += delta[i][j][0];
      dp[i][j][1] += delta[i][j][1];
      delta[i + 1][j][1] += delta[i][j][1];
      {
        int blcnt = rowcnt[i + 1][j];
        int lo = i + 1, hi = n - 1 - blcnt;
        if (lo <= hi) {
          delta[lo][j][1] += dp[i][j][0];
          delta[hi + 1][j][1] -= dp[i][j][0];
        }
      }
      {
        int blcnt = colcnt[i][j + 1];
        int lo = j + 1, hi = m - 1 - blcnt;
        if (lo <= hi) {
          delta[i][lo][0] += dp[i][j][1];
          delta[i][hi + 1][0] -= dp[i][j][1];
        }
      }
    }
  cout << dp[n - 1][m - 1][0] + dp[n - 1][m - 1][1] << '\n';
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  pre();
  long long _t = 1;
  for (long long i = 1; i <= _t; i++) {
    solve();
  }
}
