#include <bits/stdc++.h>
using namespace std;
const int NN = 2002;
const int MOD = (int)1e9 + 7;
int n, m;
char grid[NN][NN];
int dp[2][NN][NN];
int from_right[NN][NN];
int from_bottom[NN][NN];
int sum_row[NN];
int sum_col[NN][NN];
void norm(int& x) {
  while (x >= MOD) x -= MOD;
  while (x < 0) x += MOD;
}
int get() {
  memset(dp, 0, sizeof(dp));
  memset(sum_row, 0, sizeof(sum_row));
  memset(sum_col, 0, sizeof(sum_col));
  dp[0][n - 1][m - 1] = dp[1][n - 1][m - 1] = 1;
  for (int i = n - 1; i >= 0; i--) {
    sum_row[m] = 0;
    for (int j = m - 1; j >= 0; j--) {
      sum_col[i + 1][j] = sum_col[i + 2][j] + dp[1][i + 1][j];
      norm(sum_col[i + 1][j]);
      dp[0][i][j] +=
          sum_col[i + 1][j] - sum_col[i + (n - i - from_bottom[i + 1][j])][j];
      norm(dp[0][i][j]);
      sum_row[j] = sum_row[j + 1] + dp[0][i][j];
      norm(sum_row[j]);
      dp[1][i][j] +=
          sum_row[j + 1] - sum_row[j + (m - j - from_right[i][j + 1])];
      norm(dp[1][i][j]);
    }
  }
  int res = dp[0][0][0] + dp[1][0][0];
  norm(res);
  return res;
}
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cin >> n >> m;
  if (n == 1 && m == 1) {
    cout << 1 << endl;
    return 0;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) cin >> grid[i][j];
  }
  for (int i = 0; i < n; i++) {
    from_right[i][m] = 0;
    for (int j = m - 1; j >= 0; j--) {
      from_right[i][j] = from_right[i][j + 1] + (grid[i][j] == 'R');
    }
  }
  for (int j = 0; j < m; j++) {
    from_bottom[n][j] = 0;
    for (int i = n - 1; i >= 0; i--)
      from_bottom[i][j] = from_bottom[i + 1][j] + (grid[i][j] == 'R');
  }
  cout << get() << endl;
  return 0;
}
