#include <bits/stdc++.h>
using namespace std;
long double PI = 3.14159265359;
long long inf = 1000000000000000007;
long long mod = 1000000007;
long long mod1 = 998244353;
const bool multi = 0;
char g[2007][2007];
vector<long long> D[2007];
vector<long long> R[2007];
long long DP[2007][2007][2];
long long prefD[2007][2007];
long long prefR[2007][2007];
long long ileD[2007][2007];
long long ileR[2007][2007];
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long tt;
  if (multi)
    cin >> tt;
  else
    tt = 1;
  while (tt--) {
    long long n, m;
    cin >> n >> m;
    for (long long i = 1; i <= n; i++) {
      for (long long j = 1; j <= m; j++) {
        cin >> g[i][j];
      }
    }
    for (long long i = n; i > 0; i--) {
      for (long long j = m; j > 0; j--) {
        ileD[i][j] = ileD[i + 1][j];
        ileR[i][j] = ileR[i][j + 1];
        if (g[i][j] != 'R') {
          ileD[i][j]++;
          ileR[i][j]++;
        }
      }
    }
    DP[1][1][0] = 1;
    DP[1][1][1] = 1;
    for (long long i = 1; i <= n; i++) {
      for (long long j = 1; j <= m; j++) {
        if (g[i][j] == 'R') {
          D[j].push_back(i);
          R[i].push_back(j);
        }
        if (i > 1) {
          if ((long long)(D[j]).size() - (ileD[i + 1][j] + 1) >= 0)
            DP[i][j][0] =
                (prefD[i - 1][j] -
                 prefD[D[j][(long long)(D[j]).size() - (ileD[i + 1][j] + 1)] -
                       1][j] +
                 mod) %
                mod;
          else
            DP[i][j][0] = prefD[i - 1][j];
        }
        if (j > 1) {
          if ((long long)(R[i]).size() - (ileR[i][j + 1] + 1) >= 0)
            DP[i][j][1] =
                (prefR[i][j - 1] -
                 prefR[i]
                      [R[i][(long long)(R[i]).size() - (ileR[i][j + 1] + 1)] -
                       1] +
                 mod) %
                mod;
          else
            DP[i][j][1] = prefR[i][j - 1];
        }
        prefD[i][j] = (prefD[i - 1][j] + DP[i][j][1]) % mod;
        prefR[i][j] = (prefR[i][j - 1] + DP[i][j][0]) % mod;
      }
    }
    if (n == 1 && m == 1)
      cout << 1;
    else
      cout << (DP[n][m][0] + DP[n][m][1]) % mod;
  }
  return 0;
}
