#include <bits/stdc++.h>
using namespace std;
const int N = 2005;
int n, m, f[N][N][2], s[N][N][2], r[N][N][2];
char S[N][N];
inline void add(register int& p, const int q) {
  p += q, p >= 1000000007 ? p -= 1000000007 : 0;
}
inline void sub(register int& p, const int q) {
  p -= q, p < 0 ? p += 1000000007 : 0;
}
inline int add(const int x) { return x >= 1000000007 ? x - 1000000007 : x; }
inline int sub(const int x) { return x < 0 ? x + 1000000007 : x; }
int main() {
  scanf("%d%d", &n, &m);
  register int i, j;
  if (n == 1 && m == 1) return putchar('1'), 0;
  for (i = 1; i <= n; ++i) scanf("%s", S[i] + 1);
  for (i = n; i; --i)
    for (j = m; j; --j)
      r[i][j][0] = r[i][j + 1][0] + (S[i][j] == 'R'),
      r[i][j][1] = r[i + 1][j][1] + (S[i][j] == 'R');
  f[n][m][0] = f[n][m][1] = s[n][m][0] = s[n][m][1] = 1;
  for (i = n; i; --i)
    for (j = m; j; --j)
      if (i != n || j != m)
        f[i][j][0] = sub(s[i][j + 1][1] - s[i][m - r[i][j + 1][0] + 1][1]),
        f[i][j][1] = sub(s[i + 1][j][0] - s[n - r[i + 1][j][1] + 1][j][0]),
        s[i][j][0] = add(s[i + 1][j][0] + f[i][j][0]),
        s[i][j][1] = add(s[i][j + 1][1] + f[i][j][1]);
  printf("%d", add(f[1][1][0] + f[1][1][1]));
  return 0;
}
