#include <bits/stdc++.h>
using namespace std;
long long i, j, k, l, n, m, x, p, nxt, res;
long long dp[2009][2009][2], sum1[2009][2009], sum2[2009][2009];
string s;
long long a[2009][2009], cnt1[2009][2009], cnt2[2009][2009], kilk[2009][2];
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n >> m;
  for (i = 1; i <= n; i++) {
    cin >> s;
    for (j = 1; j <= m; j++) {
      if (s[j - 1] == 'R') {
        a[i][j] = 1;
        cnt1[i][++kilk[i][0]] = j;
        cnt2[j][++kilk[j][1]] = i;
      }
    }
  }
  if (n == 1 && m == 1) {
    if (a[1][1] == 1) return cout << 0 << '\n', 0;
    cout << 1 << '\n';
    exit(0);
  }
  dp[1][1][0] = 1;
  dp[1][1][1] = 1;
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= m; j++) {
      long long pos;
      if (kilk[i][0] - (m - j + 1) + 1 >= 1)
        pos = cnt1[i][kilk[i][0] - (m - j + 1) + 1];
      else
        pos = 1;
      if (pos < j && (i != 1 || j != 1)) {
        dp[i][j][0] = sum2[i][j - 1] - sum2[i][pos - 1];
        dp[i][j][0] %= 1000000007;
        dp[i][j][0] = (dp[i][j][0] + 1000000007) % 1000000007;
      }
      sum1[j][i] = (sum1[j][i - 1] + dp[i][j][0]) % 1000000007;
      if (kilk[j][1] - (n - i + 1) + 1 >= 1)
        pos = cnt2[j][kilk[j][1] - (n - i + 1) + 1];
      else
        pos = 1;
      if (pos < i && (i != 1 || j != 1)) {
        dp[i][j][1] = sum1[j][i - 1] - sum1[j][pos - 1];
        dp[i][j][1] %= 1000000007;
        dp[i][j][1] = (dp[i][j][1] + 1000000007) % 1000000007;
      }
      sum2[i][j] = (sum2[i][j - 1] + dp[i][j][1]) % 1000000007;
    }
  }
  cout << (dp[n][m][1] + dp[n][m][0]) % 1000000007 << '\n';
  exit(0);
}
