#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7, N = 2222;
void add(long long &a, long long b) {
  a += b;
  if (a >= MOD) a -= MOD;
  if (a < 0) a += MOD;
}
long long a[N][N], can_down[N][N], can_right[N][N];
signed main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  long long n, m;
  cin >> n >> m;
  vector<vector<long long>> down(n, vector<long long>(m)),
      pref_down(n + 5, vector<long long>(m + 5));
  vector<vector<long long>> right(n, vector<long long>(m)),
      pref_right(n + 5, vector<long long>(m + 5));
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < m; j++) {
      char c;
      cin >> c;
      a[i][j] = c == 'R';
    }
  }
  for (long long i = 0; i < n; i++) {
    for (long long j = m - 1; j >= 0; j--)
      can_right[i][j] = can_right[i][j + 1] + !a[i][j];
  }
  for (long long j = 0; j < m; j++) {
    for (long long i = n - 1; i >= 0; i--)
      can_down[i][j] = can_down[i + 1][j] + !a[i][j];
  }
  down[0][0] = right[0][0] = 1;
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < m; j++) {
      if (i) add(pref_down[i][j], pref_down[i - 1][j]);
      if (j) add(pref_right[i][j], pref_right[i][j - 1]);
      add(down[i][j], pref_down[i][j]);
      add(right[i][j], pref_right[i][j]);
      add(pref_down[i + 1][j], right[i][j]);
      add(pref_down[i + can_down[i + 1][j] + 1][j], -right[i][j]);
      add(pref_right[i][j + 1], down[i][j]);
      add(pref_right[i][j + can_right[i][j + 1] + 1], -down[i][j]);
    }
  }
  long long ans = down[n - 1][m - 1];
  add(ans, right[n - 1][m - 1]);
  if (n == 1 && m == 1) {
    if (a[0][0])
      ans = 0;
    else
      ans = 1;
  }
  cout << ans << '\n';
}
