#include <bits/stdc++.h>
#pragma warning(disable : 4786)
#pragma warning(disable : 4996)
using namespace std;
template <class c>
struct rge {
  c b, e;
};
template <class c>
rge<c> range(c i, c j) {
  return rge<c>{i, j};
}
template <class c>
auto dud(c* x) -> decltype(cerr << *x, 0);
template <class c>
char dud(...);
struct debug {
  template <class c>
  debug& operator<<(const c&) {
    return *this;
  }
};
const long long int MOD = 1000000007;
int n, m;
char board[3000][3000];
int rStone[3000][3000], dStone[3000][3000];
long long int dpRight[3000][3000], dpDown[3000][3000];
void solve(int ks) {
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%s", board[i] + 1);
  }
  for (int i = n; i >= 1; i--) {
    for (int j = m; j >= 1; j--) {
      dStone[i][j] = rStone[i][j] = board[i][j] == 'R';
      dStone[i][j] += dStone[i + 1][j];
      rStone[i][j] += rStone[i][j + 1];
    }
  }
  if (board[n][m] == '.') {
    dpDown[n][m] = 1;
    dpRight[n][m] = 1;
  }
  long long int ans = 0;
  for (int i = n; i >= 1; i--) {
    for (int j = m; j >= 1; j--) {
      int down = dStone[i + 1][j];
      int right = rStone[i][j + 1];
      int k;
      k = n - i - down;
      if (k) {
        dpDown[i][j] = (dpRight[i + 1][j] - dpRight[i + k + 1][j] + MOD) % MOD;
      }
      k = m - j - right;
      if (k) {
        dpRight[i][j] = (dpDown[i][j + 1] - dpDown[i][j + k + 1] + MOD) % MOD;
      }
      if (i == 1 && j == 1) {
        ans = (dpRight[1][1] + dpDown[1][1]) % MOD;
      }
      dpRight[i][j] += dpRight[i + 1][j];
      dpRight[i][j] %= MOD;
      dpDown[i][j] += dpDown[i][j + 1];
      dpDown[i][j] %= MOD;
    }
  }
  if (n == 1 && m == 1) ans = 1;
  printf("%I64d\n", ans);
}
int main() {
  if (0) {
    int T;
    scanf("%d", &T);
    for (int ks = 1; ks <= T; ks++) {
      solve(ks);
      fprintf(stderr, "%d done\n", ks);
    }
  } else {
    solve(0);
  }
  return 0;
}
