#include <bits/stdc++.h>
using namespace std;
const int M = 2005;
const int P = 1e9 + 7;
int n, m;
char Mp[M][M];
int Rs[M][M], Ds[M][M];
void Init() {
  for (int i = 1; i <= n; i++)
    for (int j = m; j >= 1; j--) Rs[i][j] = Rs[i][j + 1] + (Mp[i][j] == 'R');
  for (int j = 1; j <= m; j++)
    for (int i = n; i >= 1; i--) Ds[i][j] = Ds[i + 1][j] + (Mp[i][j] == 'R');
}
long long dp1[M][M], dp2[M][M];
void Add1(int x1, int y1, int x2, int y2, int c) {
  (dp1[x1][y1] += c) %= P;
  (dp1[x1][y2 + 1] -= c) %= P;
  (dp1[x2 + 1][y1] -= c) %= P;
  (dp1[x2 + 1][y2 + 1] += c) %= P;
}
void Add2(int x1, int y1, int x2, int y2, int c) {
  (dp2[x1][y1] += c) %= P;
  (dp2[x1][y2 + 1] -= c) %= P;
  (dp2[x2 + 1][y1] -= c) %= P;
  (dp2[x2 + 1][y2 + 1] += c) %= P;
}
void Solve() {
  if (n == 1 && m == 1) {
    puts("1");
    return;
  }
  Init();
  Add1(1, 2, 1, m - Rs[1][2], 1);
  Add2(2, 1, n - Ds[2][1], 1, 1);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) {
      dp1[i][j] =
          (dp1[i][j] - dp1[i - 1][j - 1] + dp1[i - 1][j] + dp1[i][j - 1]) % P;
      dp2[i][j] =
          (dp2[i][j] - dp2[i - 1][j - 1] + dp2[i - 1][j] + dp2[i][j - 1]) % P;
      Add1(i, j + 1, i, m - Rs[i][j + 1], dp2[i][j]);
      Add2(i + 1, j, n - Ds[i + 1][j], j, dp1[i][j]);
    }
  printf("%lld\n", (dp1[n][m] + dp2[n][m] + 2 * P) % P);
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%s", Mp[i] + 1);
  Solve();
  return 0;
}
