#include <bits/stdc++.h>
using namespace std;
template <typename T>
struct outputer;
struct outputable {};
template <typename T>
inline auto sqr(T x) -> decltype(x * x) {
  return x * x;
}
template <typename T1, typename T2>
inline bool umx(T1& a, T2 b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename T1, typename T2>
inline bool umn(T1& a, T2 b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
const int N = 2000;
const int64_t mod = 1000000007;
struct Input {
  int n, m;
  bool a[N][N];
  bool read() {
    if (!(cin >> n >> m)) {
      return 0;
    }
    string s;
    getline(cin, s);
    for (int i = int(0); i < int(n); ++i) {
      getline(cin, s);
      for (int j = int(0); j < int(m); ++j) {
        a[i][j] = (s[j] == 'R');
      }
    }
    return 1;
  }
  void init(const Input& input) { *this = input; }
};
struct Data : Input {
  int64_t ans;
  void write() { cout << ans << endl; }
};
namespace Main {
struct Solution : Data {
  int rx[N][N], ry[N][N];
  int64_t dx[N][N + 1], dy[N + 1][N];
  int64_t sx[N], sy[N];
  void solve() {
    if (n == 1 && m == 1) {
      ans = 1;
      return;
    }
    for (int i = int(0); i < int(n); ++i) {
      int cnt = 0;
      for (int j = int(m) - 1; j >= int(0); --j) {
        rx[i][j] = m - cnt;
        cnt += a[i][j];
      }
    }
    for (int j = int(0); j < int(m); ++j) {
      int cnt = 0;
      for (int i = int(n) - 1; i >= int(0); --i) {
        ry[i][j] = n - cnt;
        cnt += a[i][j];
      }
    }
    for (int i = int(0); i < int(n); ++i) {
      ;
      ;
    }
    memset(dx, 0, sizeof dx);
    memset(dy, 0, sizeof dy);
    memset(sx, 0, sizeof sx);
    memset(sy, 0, sizeof sy);
    sx[0] = 1;
    sy[0] = 1;
    for (int i = int(0); i < int(n); ++i) {
      for (int j = int(0); j < int(m); ++j) {
        (sx[i] += dx[i][j]) %= mod;
        (sy[j] += dy[i][j]) %= mod;
        int64_t curx = sx[i];
        int64_t cury = sy[j];
        ;
        if (i == n - 1 && j == m - 1) {
          ans = (curx + cury) % mod;
        }
        if (i || j) {
          (sx[i] += cury) %= mod;
          (sy[j] += curx) %= mod;
        }
        (dx[i][rx[i][j]] += mod - cury) %= mod;
        (dy[ry[i][j]][j] += mod - curx) %= mod;
      }
    }
  }
  void clear() { *this = Solution(); }
};
}  // namespace Main
Main::Solution sol;
int main() {
  cout.setf(ios::showpoint | ios::fixed);
  cout.precision(20);
  sol.read();
  sol.solve();
  sol.write();
  return 0;
}
