#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
inline int MOOD(int &x) {
  while (x >= mod) x -= mod;
  return x;
}
const int maxN = 2e3 + 5;
int N, M;
char mp[maxN][maxN];
int po[maxN][maxN][2];
int dp[maxN][maxN][2] = {0};
int pre[maxN][maxN][2] = {0};
int main() {
  scanf("%d%d", &N, &M);
  for (int i = 1; i <= N; i++) scanf("%s", mp[i] + 1);
  for (int i = 1; i <= N; i++) {
    po[i][M + 1][0] = 0;
    for (int j = M; j >= 1; j--) {
      po[i][j][0] = po[i][j + 1][0];
      if (mp[i][j] == '.') po[i][j][0]++;
    }
  }
  for (int j = 1; j <= M; j++) {
    po[N + 1][j][1] = 0;
    for (int i = N; i >= 1; i--) {
      po[i][j][1] = po[i + 1][j][1];
      if (mp[i][j] == '.') po[i][j][1]++;
    }
  }
  if (mp[N][M] == 'R') {
    printf("0\n");
    return 0;
  }
  if (N == 1 && M == 1) {
    printf("1\n");
    return 0;
  }
  dp[N][M][0] = dp[N][M][1] = 1;
  pre[N][M][0] = pre[N][M][1] = 1;
  for (int i = N, det; i >= 1; i--) {
    for (int j = M; j >= 1; j--) {
      if (i == N && j == M) continue;
      det = po[i][j + 1][0];
      dp[i][j][0] = pre[i][j + 1][1] - pre[i][j + det + 1][1] + mod;
      MOOD(dp[i][j][0]);
      det = po[i + 1][j][1];
      dp[i][j][1] = pre[i + 1][j][0] - pre[i + det + 1][j][0] + mod;
      MOOD(dp[i][j][1]);
      pre[i][j][0] = pre[i + 1][j][0] + dp[i][j][0];
      MOOD(pre[i][j][0]);
      pre[i][j][1] = pre[i][j + 1][1] + dp[i][j][1];
      MOOD(pre[i][j][1]);
    }
  }
  int ans = dp[1][1][0] + dp[1][1][1];
  printf("%d\n", MOOD(ans));
  return 0;
}
