#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const int maxn = 2 * 1e3 + 5;
int d[maxn][maxn], r[maxn][maxn], st_row[maxn][maxn], st_col[maxn][maxn],
    row_sum[maxn][maxn], col_sum[maxn][maxn];
char stat[maxn][maxn];
int res(int val1, int val2) {
  int val = val1 - val2;
  if (val >= mod) val -= mod;
  if (val < 0) val += mod;
  return val;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  if (n == 1 && m == 1) {
    cout << 1 << "\n";
    return 0;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      char c;
      cin >> c;
      if (c == 'R') stat[i][j] = true;
    }
  }
  for (int i = 0; i < n; i++)
    for (int j = m - 1; j >= 0; j--)
      st_row[i][j] = st_row[i][j + 1] + ((stat[i][j + 1]) ? 1 : 0);
  for (int j = 0; j < m; j++)
    for (int i = n - 1; i >= 0; i--)
      st_col[i][j] = st_col[i + 1][j] + ((stat[i + 1][j]) ? 1 : 0);
  for (int j = 0; j < m; j++) {
    if (st_row[n - 1][j] > 0) continue;
    r[n - 1][j] = 1;
    col_sum[n - 1][j] = 1;
  }
  for (int i = 0; i < n; i++) {
    if (st_col[i][m - 1] > 0) continue;
    d[i][m - 1] = 1;
    row_sum[i][m - 1] = 1;
  }
  for (int i = n - 2; i >= 0; i--) {
    for (int j = m - 2; j >= 0; j--) {
      int k = st_row[i][j];
      r[i][j] = res(row_sum[i][j + 1], row_sum[i][m - k]);
      k = st_col[i][j];
      d[i][j] = res(col_sum[i + 1][j], col_sum[n - k][j]);
      row_sum[i][j] = (row_sum[i][j + 1] + d[i][j]) % mod;
      col_sum[i][j] = (col_sum[i + 1][j] + r[i][j]) % mod;
    }
  }
  cout << (d[0][0] + r[0][0]) % mod << "\n";
  return 0;
}
