#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
void add(long long &a, long long b) {
  a += b;
  if (a >= mod) a -= mod;
}
void sub(long long &a, long long b) {
  a -= b;
  if (a < 0) a += mod;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m;
  cin >> n >> m;
  if (n * m == 1) {
    cout << 1 << endl;
    return 0;
  }
  bool wall[n][m];
  int down[n][m], right[n][m];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      char c;
      cin >> c;
      wall[i][j] = c == 'R';
      down[i][j] = right[i][j] = 0;
    }
  }
  for (int i = n - 1; i >= 0; i--)
    for (int j = m - 1; j >= 0; j--) {
      if (j < m - 1) right[i][j] = right[i][j + 1] + wall[i][j + 1];
      if (i < n - 1) down[i][j] = down[i + 1][j] + wall[i + 1][j];
    }
  long long dp[n][m][2];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      for (int k = 0; k < 2; k++) dp[i][j][k] = 0;
  dp[n - 1][m - 1][0] = dp[n - 1][m - 1][1] = !wall[n - 1][m - 1];
  for (int i = n - 1; i >= 0; i--) {
    for (int j = m - 1; j >= 0; j--) {
      if (i == n - 1 && j == m - 1) continue;
      if (j < m - 1) {
        dp[i][j][0] = dp[i][j + 1][1];
        if (j + 1 < m - 1 || i < n - 1) add(dp[i][j][0], dp[i][j + 1][0]);
        if (wall[i][j + 1]) sub(dp[i][j][0], dp[i][m - right[i][j]][1]);
      }
      if (i < n - 1) {
        dp[i][j][1] = dp[i + 1][j][0];
        if (i + 1 < n - 1 || j < m - 1) add(dp[i][j][1], dp[i + 1][j][1]);
        if (wall[i + 1][j]) sub(dp[i][j][1], dp[n - down[i][j]][j][0]);
      }
    }
  }
  cout << (dp[0][0][0] + dp[0][0][1]) % mod << endl;
  return 0;
}
