#include <bits/stdc++.h>
using namespace std;
const int MAX = 2222;
const long long MOD = 1e9 + 7;
char maze[MAX][MAX];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int R, C;
  cin >> R >> C;
  for (int i = 0; i < R; ++i) {
    cin >> maze[i];
  }
  if (maze[R - 1][C - 1] == 'R') {
    cout << 0 << "\n";
    return 0;
  }
  if (R == 1 && C == 1) {
    cout << 1 << "\n";
    return 0;
  }
  vector<vector<int>> rocks_below(R, vector<int>(C, 0));
  vector<vector<int>> rocks_right(R, vector<int>(C, 0));
  for (int r = R - 1; r >= 0; --r) {
    for (int c = C - 1; c >= 0; --c) {
      if (r < R - 1) {
        rocks_below[r][c] =
            rocks_below[r + 1][c] + (maze[r + 1][c] == 'R' ? 1 : 0);
      }
      if (c < C - 1) {
        rocks_right[r][c] =
            rocks_right[r][c + 1] + (maze[r][c + 1] == 'R' ? 1 : 0);
      }
    }
  }
  vector<vector<vector<long long>>> dp(
      R, vector<vector<long long>>(C, vector<long long>(2, 0)));
  ;
  for (int r = R - 1; r >= 0; --r) {
    for (int c = C - 1; c >= 0; --c) {
      if (r == R - 1 && c == C - 1) {
        dp[r][c][0] = dp[r][c][1] = 1;
        ;
        continue;
      };
      if (r + 1 < R) {
        dp[r][c][0] = (dp[r + 1][c][0] +
                       (r + 1 == R - 1 && c == C - 1 ? 0 : dp[r + 1][c][1])) %
                      MOD;
        if (maze[r + 1][c] == 'R') {
          dp[r][c][0] =
              (dp[r][c][0] - dp[R - rocks_below[r][c]][c][1] + MOD) % MOD;
        }
      };
      if (c + 1 < C) {
        dp[r][c][1] = (dp[r][c + 1][1] +
                       (r == R - 1 && c + 1 == C - 1 ? 0 : dp[r][c + 1][0])) %
                      MOD;
        if (maze[r][c + 1] == 'R') {
          dp[r][c][1] =
              (dp[r][c][1] - dp[r][C - rocks_right[r][c]][0] + MOD) % MOD;
        }
      };
    }
  }
  cout << (dp[0][0][0] + dp[0][0][1]) % MOD << "\n";
  return 0;
}
