#include <bits/stdc++.h>
using namespace std;
int dp[2000][2000][2];
int rock[2000][2000];
int xrock[2000][2000];
int yrock[2000][2000];
int ximos[2001][2001];
int yimos[2001][2001];
int xadd[2000];
int yadd[2000];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  if (n == 1 && m == 1) {
    cout << 1 << endl;
    return 0;
  }
  for (int i = 0; i < (int)(n); i++) {
    string s;
    cin >> s;
    for (int j = 0; j < (int)(m); j++) {
      if (s[j] == 'R') {
        yrock[i][j] = 1;
        xrock[i][j] = 1;
        rock[i][j] = 1;
      }
    }
  }
  for (int y = 0; y < (int)(n); y++) {
    for (int x = m - 1; x > 0; x--) xrock[y][x - 1] += xrock[y][x];
  }
  for (int x = 0; x < (int)(m); x++) {
    for (int y = n - 1; y > 0; y--) yrock[y - 1][x] += yrock[y][x];
  }
  dp[0][0][0] = dp[0][0][1] = 1;
  for (int y = 0; y < (int)(n); y++)
    for (int x = 0; x < (int)(m); x++) {
      {
        xadd[x] += yimos[y][x];
        xadd[x] %= 1000000007;
        dp[y][x][0] += xadd[x];
        int r = xrock[y][x] - rock[y][x];
        (ximos[y][x + 1] += dp[y][x][0]) %= 1000000007;
        (ximos[y][m - r] -= dp[y][x][0]) %= 1000000007;
      }
      {
        yadd[y] += ximos[y][x];
        yadd[y] %= 1000000007;
        dp[y][x][1] += yadd[y];
        int r = yrock[y][x] - rock[y][x];
        (yimos[y + 1][x] += dp[y][x][1]) %= 1000000007;
        (yimos[n - r][x] -= dp[y][x][1]) %= 1000000007;
      }
    }
  cout << ((dp[n - 1][m - 1][0] + dp[n - 1][m - 1][1]) % 1000000007 +
           1000000007) %
              1000000007
       << endl;
  return 0;
}
