#include <bits/stdc++.h>
const int MAXN = 2e3 + 10;
const int mod = 1e9 + 7;
using namespace std;
int n, m;
int sr[MAXN][MAXN], sd[MAXN][MAXN];
int f[MAXN][MAXN][2];
char a[MAXN][MAXN];
int add(int& a, int b) { return a = (a + b + mod * 2ll) % mod; }
signed main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) cin >> (a[i] + 1);
  if (n == 1 && m == 1 && a[1][1] == '.') return cout << 1 << endl, 0;
  for (int i = n; i >= 1; i--)
    for (int j = m; j >= 1; j--)
      sr[i][j] = sr[i + 1][j] + (a[i][j] == 'R'),
      sd[i][j] = sd[i][j + 1] + (a[i][j] == 'R');
  for (int i = 1; i < n; i++)
    if (!sr[i][m]) f[i][m][0] = 1;
  for (int i = 1; i < m; i++)
    if (!sd[n][i]) f[n][i][1] = 1;
  for (int i = n - 1; i >= 1; i--)
    for (int j = m - 1; j >= 1; j--) {
      add(f[i][j][0], f[i + 1][j][1]);
      add(f[i][j][1], f[i][j + 1][0]);
      if (a[i + 1][j] == 'R') {
        add(f[i][j][0], f[i + 1][j][0] - f[n - sr[i + 1][j] + 1][j][1]);
      } else {
        add(f[i][j][0], f[i + 1][j][0]);
      }
      if (a[i][j + 1] == 'R') {
        add(f[i][j][1], f[i][j + 1][1] - f[i][m - sd[i][j + 1] + 1][0]);
      } else {
        add(f[i][j][1], f[i][j + 1][1]);
      }
    }
  cout << add(f[1][1][0], f[1][1][1]) << endl;
  return 0;
}
