#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization("unroll-loops")
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, m, i, j, k;
  cin >> n >> m;
  char s[n][m + 1];
  for (i = 0; i < n; i++) cin >> s[i];
  vector<vector<int>> rx(n, vector<int>(m, 0)), ry(n, vector<int>(m, 0));
  vector<vector<long long int>> x(n, vector<long long int>(m)),
      y(n, vector<long long int>(m));
  for (i = 0; i < n; i++) {
    k = 0;
    for (j = m - 1; j >= 0; j--) {
      if (s[i][j] == 'R') k++;
      rx[i][j] = k;
    }
  }
  for (j = 0; j < m; j++) {
    k = 0;
    for (i = n - 1; i >= 0; i--) {
      if (s[i][j] == 'R') k++;
      ry[i][j] = k;
    }
  }
  for (i = n - 1; i >= 0; i--) {
    for (j = m - 1; j >= 0; j--) {
      if (i == n - 1 && j == m - 1) {
        if (s[i][j] == 'R')
          x[i][j] = y[i][j] = 0;
        else
          x[i][j] = y[i][j] = 1;
        continue;
      }
      if (i == n - 1)
        x[i][j] = y[i][j] = (x[i][j + 1] == 1 && s[i][j] == '.');
      else if (j == m - 1)
        x[i][j] = y[i][j] = (x[i + 1][j] == 1 && s[i][j] == '.');
      else {
        if (s[i][j] == '.') {
          x[i][j] = (x[i][j + 1] + y[i + 1][j]) % (int)(1e9 + 7);
          y[i][j] = (y[i + 1][j] + x[i][j + 1]) % (int)(1e9 + 7);
        } else {
          x[i][j] = (x[i][j + 1] + y[i + 1][j] - y[i + 1][m - rx[i][j]]) %
                    (int)(1e9 + 7);
          y[i][j] = (y[i + 1][j] + x[i][j + 1] - x[n - ry[i][j]][j + 1]) %
                    (int)(1e9 + 7);
        }
      }
    }
  }
  cout << ((int)(1e9 + 7) + x[0][0]) % (int)(1e9 + 7) << endl;
}
