#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
using namespace std;
const int mod = 1e9 + 7;
int n, m;
int f[2010][2010][2], s[2010][2010];
int add[2010][2010][2];
int main() {
  ios ::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j) {
      char c;
      cin >> c;
      s[i][j] = s[i - 1][j] + s[i][j - 1] - s[i - 1][j - 1] + (c == 'R');
    }
  if (n == 1 && m == 1) {
    cout << !s[n][m];
    exit(0);
  }
  auto get = [&](int x, int y, int u, int v) {
    return s[u][v] - s[x - 1][v] - s[u][y - 1] + s[x - 1][y - 1];
  };
  auto upd_rect = [&](int x, int y, int u, int v, int o, int val) {
    add[x][y][o] += val;
    if (add[x][y][o] >= mod) add[x][y][o] -= mod;
    add[u + 1][v + 1][o] += val;
    if (add[u + 1][v + 1][o] >= mod) add[u + 1][v + 1][o] -= mod;
    add[x][v + 1][o] -= val;
    if (add[x][v + 1][o] < 0) add[x][v + 1][o] += mod;
    add[u + 1][y][o] -= val;
    if (add[u + 1][y][o] < 0) add[u + 1][y][o] += mod;
  };
  f[1][1][0] = f[1][1][1] = 1;
  for (int u = 1; u <= n; ++u) {
    for (int v = 1; v <= m; ++v) {
      add[u][v][0] +=
          (add[u - 1][v][0] + add[u][v - 1][0] - add[u - 1][v - 1][0]) % mod;
      add[u][v][1] +=
          (add[u - 1][v][1] + add[u][v - 1][1] - add[u - 1][v - 1][1]) % mod;
      if (add[u][v][0] >= mod) add[u][v][0] -= mod;
      if (add[u][v][0] < 0) add[u][v][0] += mod;
      if (add[u][v][1] >= mod) add[u][v][1] -= mod;
      if (add[u][v][1] < 0) add[u][v][1] += mod;
      f[u][v][0] += add[u][v][0];
      f[u][v][1] += add[u][v][1];
      int need = get(u + 1, v, n, v);
      int L = u, R = n;
      while (R - L > 1) {
        int mid = L + R >> 1;
        if (n - mid >= need)
          L = mid;
        else
          R = mid;
      }
      if (n - R >= need)
        upd_rect(u + 1, v, R, v, 1, f[u][v][0]);
      else
        upd_rect(u + 1, v, L, v, 1, f[u][v][0]);
      need = get(u, v + 1, u, m);
      L = v, R = m;
      while (R - L > 1) {
        int mid = L + R >> 1;
        if (m - mid >= need)
          L = mid;
        else
          R = mid;
      }
      if (m - R >= need)
        upd_rect(u, v + 1, u, R, 0, f[u][v][1]);
      else
        upd_rect(u, v + 1, u, L, 0, f[u][v][1]);
    }
  }
  cout << (f[n][m][0] + f[n][m][1]) % mod;
}
