#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
const int N = 500031;
int n, m;
string st;
int board[2031][2031], right_cnt[2031][2031], down_cnt[2031][2031];
int up[2031][2031], asdgashgrketwjklrej[2031][2031];
int pref_row[2031][2031];
int pref_col[2031][2031];
int dp_up[2031][2031], dp_left[2031][2031];
void normalize(int& x) {
  if (x < 0) x += 1000000007;
  while (x >= 1000000007) x -= 1000000007;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> m;
  if (n == 1 && m == 1) {
    cout << 1 << endl;
    return 0;
  }
  getline(cin, st);
  for (int i = 1; i <= n; i++) {
    getline(cin, st);
    for (int j = 1; j <= m; j++) {
      if (st[j - 1] == 'R')
        board[i][j] = 1;
      else
        board[i][j] = 0;
    }
  }
  for (int i = n; i >= 1; --i) {
    for (int j = m; j >= 1; --j) {
      right_cnt[i][j] = right_cnt[i][j + 1] + board[i][j];
      down_cnt[i][j] = down_cnt[i + 1][j] + board[i][j];
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (i == 1)
        up[i][j] = 1;
      else {
        up[i][j] = up[i - 1][j];
        while (down_cnt[up[i][j] + 1][j] > n - i) ++up[i][j];
      }
      if (j == 1) {
        asdgashgrketwjklrej[i][j] = 1;
      } else {
        asdgashgrketwjklrej[i][j] = asdgashgrketwjklrej[i][j - 1];
        while (right_cnt[i][asdgashgrketwjklrej[i][j] + 1] > m - j)
          ++asdgashgrketwjklrej[i][j];
      }
    }
  }
  dp_up[1][1] = 1;
  dp_left[1][1] = 1;
  pref_row[1][1] = 1;
  pref_col[1][1] = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (i == 1 && j == 1) continue;
      if (asdgashgrketwjklrej[i][j] < j) {
        dp_left[i][j] = (dp_left[i][j] + pref_row[i][j - 1] -
                         pref_row[i][asdgashgrketwjklrej[i][j] - 1]);
        normalize(dp_left[i][j]);
      }
      if (up[i][j] < i) {
        dp_up[i][j] =
            (dp_up[i][j] + pref_col[i - 1][j] - pref_col[up[i][j] - 1][j]);
        normalize(dp_up[i][j]);
      }
      pref_row[i][j] = pref_row[i][j - 1] + dp_up[i][j];
      pref_col[i][j] = pref_col[i - 1][j] + dp_left[i][j];
      normalize(pref_row[i][j]);
      normalize(pref_col[i][j]);
    }
  }
  cout << (dp_up[n][m] + dp_left[n][m]) % 1000000007 << endl;
  return 0;
}
