#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2000 + 10;
const long long INF = 2 * 1e9 + 10;
const int MOD = 1e9 + 7;
int n, m;
char c[MAXN][MAXN];
int down[MAXN][MAXN], ri[MAXN][MAXN];
int dp[MAXN][MAXN][2];
int ADD(int x, int y) {
  int res = x + y;
  if (res >= MOD) res -= MOD;
  return res;
}
int SUB(int x, int y) {
  int res = x - y;
  if (res < 0) res += MOD;
  return res;
}
void upd(vector<int> &sum, int pos, int val) {
  while (pos < sum.size()) {
    sum[pos] = ADD(sum[pos], val);
    pos |= (pos + 1);
  }
}
int get(vector<int> &sum, int pos) {
  int res = 0;
  while (pos >= 0) {
    res = ADD(res, sum[pos]);
    pos = (pos & (pos + 1)) - 1;
  }
  return res;
}
void calc_down_ri() {
  for (int j = 0; j < m; j++) {
    for (int i = n - 1; i >= 0; i--)
      down[i][j] = down[i + 1][j] + (int)(c[i + 1][j] == 'R');
  }
  for (int i = 0; i < n; i++) {
    for (int j = m - 1; j >= 0; j--)
      ri[i][j] = ri[i][j + 1] + (int)(c[i][j + 1] == 'R');
  }
}
int get_pos_up(int i, int j) {
  int maxx = n - i;
  int l = -1, r = i;
  while (r - l > 1) {
    int mid = (l + r) / 2;
    down[mid][j] < maxx ? r = mid : l = mid;
  }
  return r;
}
int get_pos_ri(int i, int j) {
  int maxx = m - j;
  int l = -1, r = j;
  while (r - l > 1) {
    int mid = (l + r) / 2;
    ri[i][mid] < maxx ? r = mid : l = mid;
  }
  return r;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  if (n == 1 && m == 1) {
    cout << 1;
    return 0;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> c[i][j];
    }
  }
  calc_down_ri();
  dp[0][0][0] = 1;
  dp[0][0][1] = 1;
  vector<vector<int> > sum_up, sum_l;
  sum_up.resize(m);
  sum_l.resize(n);
  for (int i = 0; i < m; i++) sum_up[i].resize(n);
  for (int i = 0; i < n; i++) sum_l[i].resize(m);
  upd(sum_up[0], 0, 1);
  upd(sum_l[0], 0, 1);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (i == 0 && j == 0) continue;
      int pos = get_pos_up(i, j);
      dp[i][j][0] = SUB(get(sum_up[j], i), get(sum_up[j], pos - 1));
      pos = get_pos_ri(i, j);
      dp[i][j][1] = SUB(get(sum_l[i], j), get(sum_l[i], pos - 1));
      upd(sum_up[j], i, dp[i][j][1]);
      upd(sum_l[i], j, dp[i][j][0]);
    }
  }
  cout << ADD(dp[n - 1][m - 1][0], dp[n - 1][m - 1][1]);
  return 0;
}
