#include <bits/stdc++.h>
using namespace std;
template <class T>
bool umin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool umax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
const int N = 2e3 + 4;
int dp[2][N][N];
int par[2][N][N];
char arr[N][N];
int ri[N][N], up[N][N];
int mod(int x) {
  if (x >= 1000000007) x -= 1000000007;
  if (x < 0) x += 1000000007;
  return x;
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) scanf(" %c", &arr[i][j]);
  if (arr[n][m] == 'R') return puts("0") * 0;
  if (n == 1 and m == 1) return puts("1") * 0;
  for (int i = 1; i <= n; i++)
    for (int j = m; j >= 1; j--) {
      if (arr[i][j] == 'R')
        ri[i][j] = ri[i][j + 1];
      else
        ri[i][j] = ri[i][j + 1] + 1;
    }
  for (int i = n; i >= 1; i--)
    for (int j = 1; j <= m; j++) {
      if (arr[i][j] == 'R')
        up[i][j] = up[i + 1][j];
      else
        up[i][j] = up[i + 1][j] + 1;
    }
  for (int x = n; x >= 1; x--)
    for (int y = m; y >= 1; y--) {
      if (x == n and y == m) dp[0][x][y] = dp[1][x][y] = 1;
      if (y + 1 <= m)
        dp[0][x][y] = mod(par[1][x][y + 1] - par[1][x][y + ri[x][y + 1] + 1]);
      if (x + 1 <= n)
        dp[1][x][y] = mod(par[0][x + 1][y] - par[0][x + up[x + 1][y] + 1][y]);
      par[1][x][y] = mod(par[1][x][y + 1] + dp[1][x][y]);
      par[0][x][y] = mod(par[0][x + 1][y] + dp[0][x][y]);
    }
  printf("%d\n", mod(dp[0][1][1] + dp[1][1][1]));
  return 0;
}
