#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
const int BIG = 1e9 + 555;
const int maxN = 2000 + 5;
const int MOD = 1e9 + 7;
int m, n;
int psum[maxN][maxN], rt[maxN][maxN], dw[maxN][maxN], sumRt[maxN][maxN],
    sumDw[maxN][maxN];
char cell[maxN][maxN];
int get(int x, int y, int u, int v) {
  if (x > u || y > v) {
    return 0;
  }
  return psum[u][v] - psum[x - 1][v] - psum[u][y - 1] + psum[x - 1][y - 1];
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> m >> n;
  for (int i = 1; i <= m; i++) {
    cin >> (cell[i] + 1);
  }
  for (int i = 1; i <= m; i++) {
    for (int j = 1; j <= n; j++) {
      psum[i][j] = (cell[i][j] == 'R');
    }
  }
  for (int i = 1; i <= m; i++) {
    for (int j = 1; j <= n; j++) {
      psum[i][j] += psum[i][j - 1];
    }
  }
  for (int i = 1; i <= m; i++) {
    for (int j = 1; j <= n; j++) {
      psum[i][j] += psum[i - 1][j];
    }
  }
  rt[m][n] = dw[m][n] = 1;
  sumRt[m][n] = sumDw[m][n] = 1;
  for (int i = m; i > 0; i--) {
    for (int j = n; j > 0; j--) {
      int blank = (m - (i + 1) + 1 - get(i + 1, j, m, j));
      if (blank) {
        dw[i][j] =
            (((sumRt[i + 1][j] - sumRt[i + blank + 1][j]) % MOD) + MOD) % MOD;
      }
    }
    for (int j = n; j > 0; j--) {
      sumDw[i][j] = (sumDw[i][j + 1] + dw[i][j]) % MOD;
    }
    for (int j = n; j > 0; j--) {
      int blank = (n - (j + 1) + 1 - get(i, j + 1, i, n));
      if (blank) {
        rt[i][j] =
            (((sumDw[i][j + 1] - sumDw[i][j + blank + 1]) % MOD) + MOD) % MOD;
      }
    }
    for (int j = 1; j <= n; j++) {
      sumRt[i][j] = (sumRt[i + 1][j] + rt[i][j]) % MOD;
    }
  }
  if (n == m && n == 1) {
    cout << ((cell[1][1] == 'R') ? 0 : 1) << '\n';
    return 0;
  }
  int ans = (rt[1][1] + dw[1][1]) % MOD;
  cout << ans << '\n';
  return 0;
}
