#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
char mat[2002][2002];
int rocks_down[2002][2002], rocks_right[2002][2002];
int n, m;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  ;
  cin >> n >> m;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      cin >> mat[i][j];
      if (mat[i][j] == 'R') {
        rocks_right[i][j] = 1;
        rocks_down[i][j] = 1;
      }
    }
  }
  for (int i = 0; i < n; ++i) {
    for (int j = m - 2; j >= 0; --j) {
      rocks_right[i][j] += rocks_right[i][j + 1];
    }
  }
  for (int j = 0; j < m; ++j) {
    for (int i = n - 2; i >= 0; --i) {
      rocks_down[i][j] += rocks_down[i + 1][j];
    }
  }
  long long ans = 0;
  long long D[n][m], R[n][m];
  memset(D, 0, sizeof D);
  memset(R, 0, sizeof R);
  D[n - 1][m - 1] = R[n - 1][m - 1] = 1;
  for (int i = n - 1; i >= 0; i--) {
    for (int j = m - 1; j >= 0; j--) {
      int x = i, y = j;
      int stns = rocks_right[i][j + 1];
      int len = m - y - 1;
      long long tmp = D[x][y + 1] - D[x][y + 1 + (len - stns)];
      tmp %= MOD;
      R[x][y] += tmp;
      stns = rocks_down[i + 1][j];
      len = n - i - 1;
      tmp = R[x + 1][y] - R[x + 1 + (len - stns)][y];
      tmp %= MOD;
      D[x][y] += tmp;
      if (x == 0 and y == 0) continue;
      D[x][y] += D[x][y + 1];
      R[x][y] += R[x + 1][y];
    }
  }
  ans = D[0][0] + R[0][0];
  if (n == 1 and m == 1) {
    ans = 1;
  }
  ans %= MOD;
  if (ans < 0) ans += MOD;
  cout << ans << "\n";
}
