#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char c = getchar();
  for (; !isdigit(c); c = getchar())
    if (c == '-') f = -1;
  for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
  return x * f;
}
const int INF = 2147483600;
const int MAXN = 100010;
const long long Mod = 1000000007LL;
int N, M;
int g[2010][2010][2];
int sl[2010][2010], sc[2010][2010];
char str[2010][2010];
const long long inv2 = (Mod + 1) / 2;
inline void Add(int &a, int b) { a = (a + b >= Mod ? a + b - Mod : a + b); }
int main() {
  N = read(), M = read();
  for (int i = 1; i <= N; i++) scanf("%s", str[i] + 1);
  for (int i = 1; i <= N; i++) {
    for (int j = M; j >= 1; j--) sl[i][j] = sl[i][j + 1] + (str[i][j] == 'R');
  }
  for (int j = 1; j <= M; j++) {
    for (int i = N; i >= 1; i--) sc[j][i] = sc[j][i + 1] + (str[i][j] == 'R');
  }
  g[1][1][0] = g[1][1][1] = 1;
  g[N - sc[1][2] + 1][1][0] = Mod - 1;
  g[1][M - sl[1][2] + 1][1] = Mod - 1;
  long long f0, f1;
  for (int i = 1; i <= N; i++) {
    for (int j = 1; j <= M; j++) {
      Add(g[i][j][0], g[i - 1][j][0]);
      Add(g[i][j][1], g[i][j - 1][1]);
      f0 = g[i][j][0], f1 = g[i][j][1];
      g[i][j][0] += f1;
      g[i][j][0] %= Mod;
      g[i][j][1] += f0;
      g[i][j][1] %= Mod;
      Add(g[N - sc[j][i + 1] + 1][j][0], Mod - f1);
      Add(g[i][M - sl[i][j + 1] + 1][1], Mod - f0);
    }
  }
  printf("%I64d\n", (long long)(f0 + f1) % Mod * inv2 % Mod);
  return 0;
}
