#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
int M, N;
int s[2001][2001];
int f[2][2001][2001];
int IT[2][2001][8001];
int Cal(const int &x, const int &y, const int &u, const int &v) {
  return s[u][v] - s[x - 1][v] - s[u][y - 1] + s[x - 1][y - 1];
}
int sum(const int &a, const int &b) {
  if (a + b >= MOD) return a - MOD + b;
  return a + b;
}
void UD(const int &id, const int &l, const int &r, const int &i, const int &val,
        const int &type1, const bool &type2) {
  if (l == r) {
    IT[type2][type1][id] = sum(IT[type2][type1][id], val);
    return;
  }
  if (i <= ((l + r) >> 1))
    UD((id << 1), l, ((l + r) >> 1), i, val, type1, type2);
  else
    UD((id << 1 | 1), ((l + r) >> 1) + 1, r, i, val, type1, type2);
  IT[type2][type1][id] =
      sum(IT[type2][type1][(id << 1)], IT[type2][type1][(id << 1 | 1)]);
}
int GT(const int &id, const int &l, const int &r, const int &u, const int &v,
       const int &type1, const bool &type2) {
  if (l > v || r < u) return 0;
  if (l >= u && r <= v) return IT[type2][type1][id] % MOD;
  int mid = (r + l) >> 1;
  return sum(GT((id << 1), l, ((l + r) >> 1), u, v, type1, type2),
             GT((id << 1 | 1), ((l + r) >> 1) + 1, r, u, v, type1, type2));
}
int main() {
  cin.tie(0)->sync_with_stdio(0);
  cin >> M >> N;
  for (int i = 1; i <= M; ++i) {
    for (int j = 1; j <= N; ++j) {
      char x;
      cin >> x;
      s[i][j] = s[i][j - 1] + s[i - 1][j] - s[i - 1][j - 1] + (x == 'R');
    }
  }
  if (M == 1 && N == 1) {
    cout << 1;
    return 0;
  }
  f[0][1][1] = 1;
  f[1][1][1] = 1;
  UD(1, 1, M, M - Cal(2, 1, M, 1), 1, 1, 0);
  UD(1, 1, N, N - Cal(1, 2, 1, N), 1, 1, 1);
  for (int i = 1; i <= M; ++i) {
    for (int j = 1; j <= N; ++j) {
      if (i + j == 2) continue;
      f[0][i][j] = GT(1, 1, M, i, M, j, 0);
      f[1][i][j] = GT(1, 1, N, j, N, i, 1);
      UD(1, 1, M, M - Cal(i + 1, j, M, j), f[1][i][j], j, 0);
      UD(1, 1, N, N - Cal(i, j + 1, i, N), f[0][i][j], i, 1);
    }
  }
  cout << sum(f[1][M][N], f[0][M][N]);
}
