#include <bits/stdc++.h>
int getbit(long long x, int y) { return (x >> y) & 1; }
long long getoff(long long x, int y) { return x ^ ((1ll) << y); }
const long long oo = 1e9 + 7;
using namespace std;
int n, m, b[2010][2010], g[2010][2010][2];
long long f[2010][2010][2];
bool a[2010][2010];
int dem(int x, int y, int z, int t) {
  return b[z][t] - b[x - 1][t] - b[z][y - 1] + b[x - 1][y - 1];
}
void update(int ch, int i, int j, int val) {
  f[i][j][ch] = (f[i][j][ch] + val) % oo;
}
int get(int ch, int i, int j) { return f[i][j][ch]; }
int gett(int ch, int x, int y, int z, int t) {
  int rb = get(ch, z, t);
  int rt = get(ch, x - 1, t);
  int lb = get(ch, z, y - 1);
  int lt = get(ch, x - 1, y - 1);
  return (rb - rt - lb + lt + oo * 2) % oo;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j) {
      char x;
      cin >> x;
      if (x == 'R') a[i][j] = 1;
      b[i][j] = b[i - 1][j] + b[i][j - 1] - b[i - 1][j - 1] + a[i][j];
    }
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j) {
      if (i == 1 && j == 1) {
        if (dem(1, 1, 1, m) < m) update(0, 1, 1, 1);
        if (dem(1, 1, n, 1) < n) update(1, 1, 1, 1);
        continue;
      }
      f[i][j][0] = (0ll + f[i][j][0] + f[i - 1][j][0] + f[i][j - 1][0] -
                    f[i - 1][j - 1][0] + oo) %
                   oo;
      f[i][j][1] = (0ll + f[i][j][1] + f[i - 1][j][1] + f[i][j - 1][1] -
                    f[i - 1][j - 1][1] + oo) %
                   oo;
      int gh = m - j - dem(i, j, i, m);
      int l = 1;
      int r = j;
      while (l < r) {
        int mid = (l + r) >> 1;
        if (dem(i, mid + 1, i, j - 1) > gh)
          l = mid + 1;
        else
          r = mid;
      }
      int tmp = gett(1, i, l, i, j - 1);
      g[i][j][0] = tmp;
      update(0, i, j, tmp);
      gh = n - i - dem(i, j, n, j);
      l = 1;
      r = i;
      while (l < r) {
        int mid = (l + r) >> 1;
        if (dem(mid + 1, j, i - 1, j) > gh)
          l = mid + 1;
        else
          r = mid;
      }
      tmp = gett(0, l, j, i - 1, j);
      g[i][j][1] = tmp;
      update(1, i, j, tmp);
    }
  g[1][1][0] = 1;
  cout << (g[n][m][0] + g[n][m][1]) % oo;
  return 0;
}
