#include <bits/stdc++.h>
using namespace std;
const int N = 2e3 + 5;
const long long inf = 0x3f3f3f3f3f3f3f3f;
const int mod = 1e9 + 7;
const int bs = 31;
const double eps = 1e-8;
const long long zzz = 1e9;
struct IN {
  inline char gc() {
    static const int len = 1 << 18 | 1;
    static char buf[len], *s, *t;
    return (s == t) && (t = (s = buf) + fread(buf, 1, len, stdin)),
           s == t ? -1 : *s++;
  }
  template <typename TP>
  inline IN& operator>>(TP& x) {
    static char c, f;
    c = gc(), f = 0;
    for (; !isdigit(c); c = gc()) {
      if (c == -1) return *this;
      f |= c == '-';
    }
    for (x = 0; isdigit(c); c = gc()) x = (x << 3) + (x << 1) + (c ^ '0');
    f && (x = -x);
    return *this;
  }
  inline IN& operator>>(char* s) {
    char c;
    c = gc();
    while (isspace(c)) c = gc();
    if (c == -1) return *this;
    while (!isspace(c)) *s = 0, *s = c, s++, c = gc();
    *s = 0;
    return *this;
  }
} io;
char c[N][N];
int line[N][N], col[N][N];
long long cf[N][N][5];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m;
  io >> n >> m;
  if (n == 1 && m == 1) {
    cout << 1 << endl;
    return 0;
  }
  for (int i = 1; i <= n; i++) io >> &c[i][1];
  for (int i = n; i >= 1; i--)
    for (int j = m; j >= 1; j--) {
      line[i][j] = line[i][j + 1] + (c[i][j + 1] == 'R');
      col[i][j] = col[i + 1][j] + (c[i + 1][j] == 'R');
    }
  cf[1][1][1] = cf[1][1][0] = 1, cf[1][2][0] = cf[2][1][1] = -1;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      cf[i][j][0] = (cf[i][j][0] + cf[i][j - 1][0]) % mod;
      cf[i][j][1] = (cf[i][j][1] + cf[i - 1][j][1]) % mod;
      cf[i][j + 1][0] = (cf[i][j + 1][0] + cf[i][j][1]) % mod;
      cf[i][m + 1 - line[i][j]][0] =
          (cf[i][m + 1 - line[i][j]][0] - cf[i][j][1] + mod) % mod;
      cf[i + 1][j][1] = (cf[i + 1][j][1] + cf[i][j][0]) % mod;
      cf[n + 1 - col[i][j]][j][1] =
          (cf[n + 1 - col[i][j]][j][1] - cf[i][j][0] + mod) % mod;
    }
  cout << (cf[n][m][0] + cf[n][m][1]) % mod << endl;
  return 0;
}
