#include <bits/stdc++.h>
using namespace std;
const long long int MOD = 1000000007;
const long long BIG = 1446803456761533460LL;
const int Big = 336860180;
const long long int INF = LONG_LONG_MAX;
const long long int adj4[4][2] = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}};
const long long int adj8[8][2] = {{0, 1},   {0, -1}, {1, 0},  {-1, 0},
                                  {-1, -1}, {1, -1}, {-1, 1}, {1, 1}};
long long int gcd(long long int a, long long int b) {
  return b == 0 ? a : gcd(b, a % b);
}
long long int powMod(long long int a, long long int b) {
  long long int n = 1;
  long long int p = a;
  while (b > 0) {
    if (b % 2 == 1) {
      n *= p;
      n %= MOD;
    }
    p *= p;
    p %= MOD;
    b /= 2;
  }
  return n;
}
long long int modularInverse(long long int a) { return powMod(a, MOD - 2); }
stringstream sss;
const long long int maxn = 2010;
char grid[maxn][maxn];
long long int dp[maxn][maxn][2];
long long int ps[maxn][maxn][2];
long long int rows[maxn][maxn];
long long int cols[maxn][maxn];
void MAIN() {
  long long int n, m;
  cin >> n >> m;
  for (long long int i = (0); i < (n); ++i) {
    for (long long int j = (0); j < (m); ++j) {
      cin >> grid[i][j];
    }
  }
  if (1 == m && n == 1) {
    cout << (1) << '\n';
    return;
  }
  for (long long int i = (n)-1; i >= (0); --i) {
    for (long long int j = (m)-1; j >= (0); --j) {
      rows[i][j] = rows[i][j + 1] + (grid[i][j] == 'R');
      cols[i][j] = cols[i + 1][j] + (grid[i][j] == 'R');
    }
  }
  dp[1][1][0] = dp[1][1][1] = 1;
  for (long long int i = (1); i < (n + 1); ++i) {
    for (long long int j = (1); j < (m + 1); ++j) {
      long long int l = 0;
      long long int r = i;
      while (r - l > 1) {
        long long int k = (l + r) / 2;
        if (cols[k][j - 1] <= n - i && rows[k][j] <= m - j) {
          r = k;
        } else {
          l = k;
        }
      }
      dp[i][j][0] = (dp[i][j][0] + (ps[i - 1][j][1] - ps[l][j][1] + MOD)) % MOD;
      l = 0;
      r = j;
      while (r - l > 1) {
        long long int k = (l + r) / 2;
        if (rows[i - 1][k] <= m - j && cols[i][k] <= n - i) {
          r = k;
        } else {
          l = k;
        }
      }
      dp[i][j][1] = (dp[i][j][1] + (ps[i][j - 1][0] - ps[i][l][0] + MOD)) % MOD;
      ps[i][j][0] = (ps[i][j - 1][0] + dp[i][j][0]) % MOD;
      ps[i][j][1] = (ps[i - 1][j][1] + dp[i][j][1]) % MOD;
    }
  }
  cout << ((dp[n][m][0] + dp[n][m][1]) % MOD) << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout << fixed << setprecision(10);
  sss << R"(
4 4
...R
.RR.
.RR.
R...
    )";
  MAIN();
  return 0;
}
