#include <bits/stdc++.h>
using namespace std;
const int md = 1e9 + 7;
int r[2005][2005], d[2005][2005], prefix_v[2005][2005], prefix_h[2005][2005];
char a[2005][2005];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  cin >> n >> m;
  if (max(n, m) == 1) return cout << 1 << endl, 0;
  for (int i = 1; i <= n; ++i) cin >> (a[i] + 1);
  for (int i = n; i > 0; --i)
    for (int j = m; j > 0; --j) {
      prefix_h[i][j] = prefix_h[i][j + 1] + (a[i][j] == 'R');
      prefix_v[i][j] = prefix_v[i + 1][j] + (a[i][j] == 'R');
    }
  r[n][m] = d[n][m] = 1;
  for (int i = 1; i < m; ++i) r[n][i] = !prefix_h[n][i + 1];
  for (int i = 1; i < n; ++i) d[i][m] = !prefix_v[i + 1][m];
  for (int i = n - 1; i > 0; --i)
    for (int j = m - 1; j > 0; --j) {
      d[i][j] = d[i + 1][j] + r[i + 1][j];
      if (a[i + 1][j] == 'R') d[i][j] -= r[n - prefix_v[i + 1][j] + 1][j];
      r[i][j] = r[i][j + 1] + d[i][j + 1];
      if (a[i][j + 1] == 'R') r[i][j] -= d[i][m - prefix_h[i][j + 1] + 1];
      while (d[i][j] >= md) d[i][j] -= md;
      while (d[i][j] < 0) d[i][j] += md;
      while (r[i][j] >= md) r[i][j] -= md;
      while (r[i][j] < 0) r[i][j] += md;
    }
  cout << (d[1][1] + r[1][1]) % md << endl;
}
