#include <bits/stdc++.h>
using namespace std;
long long mod = (1000000007LL);
inline long long mult(long long a, long long b) { return (a * b) % mod; }
inline long long poww(long long a, long long b) {
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = (res * a) % mod;
    a = (a * a) % mod;
    b >>= 1;
  }
  return res;
}
long long gcd(long long a, long long b) {
  while (b) {
    a %= b, swap(a, b);
  }
  return a;
}
void read(vector<int> &w, int n) {
  w.resize(n);
  for (int i = 0; i < n; i++) cin >> w[i];
}
void print(vector<int> &w) {
  for (int i = 0; i < (int)(w).size(); i++) {
    if (i == (int)(w).size() - 1)
      cout << w[i] << "\n";
    else
      cout << w[i] << " ";
  }
}
int n, m, dp[2][2020][2020], cnt[2020][2020], cnt2[2020][2020];
int pref[2][2020][2020];
vector<int> rocks[2][2020];
char mat[2020][2020];
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      cin >> mat[i][j];
      if (mat[i][j] == 'R') {
        rocks[0][i].push_back(j);
        rocks[1][j].push_back(i);
      }
    }
  }
  for (int i = n; i >= 1; i--)
    for (int j = m; j >= 1; j--) {
      cnt[i][j] = (mat[i][j] == 'R') + cnt[i + 1][j];
      cnt2[i][j] = (mat[i][j] == 'R') + cnt2[i][j + 1];
    }
  for (int i = n; i >= 1; i--) {
    for (int j = m; j >= 1; j--) {
      if (i == n and j == m) {
        dp[0][i][j] = (mat[i][j] == '.');
        dp[1][i][j] = (mat[i][j] == '.');
      } else {
        dp[0][i][j] =
            (pref[1][i + 1][j] - pref[1][n - cnt[i + 1][j] + 1][j]) % mod;
        dp[1][i][j] =
            (pref[0][i][j + 1] - pref[0][i][m - cnt2[i][j + 1] + 1]) % mod;
        if (dp[0][i][j] < 0) dp[0][i][j] += mod;
        if (dp[1][i][j] < 0) dp[1][i][j] += mod;
      }
      pref[0][i][j] = (pref[0][i][j + 1] + dp[0][i][j]) % mod;
      pref[1][i][j] = (pref[1][i + 1][j] + dp[1][i][j]) % mod;
    }
  }
  cout << ((n == 1 and m == 1) ? (mat[1][1] == '.' ? 1 : 0)
                               : (dp[0][1][1] + dp[1][1][1]) % mod)
       << "\n";
}
