#include <bits/stdc++.h>
using namespace std;
long long int em(long long int x, long long int Mod, long long int n) {
  if (n == 0)
    return 1ll;
  else if (n % 2 == 0)
    return em((x % Mod * x % Mod) % Mod, Mod, n / 2) % Mod;
  else
    return (x % Mod * em((x % Mod * x % Mod) % Mod, Mod, (n - 1) / 2)) % Mod;
}
int32_t main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n, m, i, j, k, l;
  cin >> n >> m;
  char arr[n + 3][m + 3];
  long long int dp[n + 3][m + 3][2], ways[n + 3][m + 3];
  vector<long long int> row[n + 1], col[m + 1];
  memset((ways), 0, sizeof(ways));
  memset((dp), 0, sizeof(dp));
  for (long long int i = (long long int)1; i < (long long int)n + 1; i++) {
    for (long long int j = (long long int)1; j < (long long int)m + 1; j++) {
      cin >> arr[i][j];
      if (arr[i][j] == 'R') {
        row[i].push_back(j);
        col[j].push_back(i);
      }
    }
  }
  ways[1][1] = 1;
  for (long long int i = (long long int)2;
       i < (long long int)(m - row[1].size() + 1); i++)
    ways[1][i] = dp[1][i][0] = 1;
  for (long long int i = (long long int)2;
       i < (long long int)(n - col[1].size() + 1); i++)
    ways[i][1] = dp[i][1][1] = 1;
  for (long long int i = (long long int)2; i < (long long int)n + 1; i++) {
    for (long long int j = (long long int)2; j < (long long int)m + 1; j++) {
      long long int num =
          lower_bound(col[j].begin(), col[j].end(), i) - col[j].begin();
      long long int gap = n - i - col[j].size() + num;
      long long int up = 0, right = 0;
      if (gap >= 0) {
        up = dp[i - 1][j][0];
        if (num > gap)
          up = (up - dp[col[j][num - gap - 1] - 1][j][0] + 1000000007) %
               1000000007;
      }
      num = lower_bound(row[i].begin(), row[i].end(), j) - row[i].begin();
      gap = m - j - row[i].size() + num;
      if (gap >= 0) {
        right = dp[i][j - 1][1];
        if (num > gap)
          right = (right - dp[i][row[i][num - gap - 1] - 1][1] + 1000000007) %
                  1000000007;
      }
      dp[i][j][1] = (up + dp[i][j - 1][1]) % 1000000007;
      dp[i][j][0] = (right + dp[i - 1][j][0]) % 1000000007;
      ways[i][j] = (up + right) % 1000000007;
    }
  }
  cout << ways[n][m];
}
