You are at the top left cell (1, 1) of an n × m labyrinth. Your goal is to get to the bottom right cell (n, m). You can only move right or down, one cell per step. Moving right from a cell (x, y) takes you to the cell (x, y + 1), while moving down takes you to the cell (x + 1, y).

Some cells of the labyrinth contain rocks. When you move to a cell with rock, the rock is pushed to the next cell in the direction you're moving. If the next cell contains a rock, it gets pushed further, and so on.

The labyrinth is surrounded by impenetrable walls, thus any move that would put you or any rock outside of the labyrinth is illegal.

Count the number of different legal paths you can take from the start to the goal modulo 10^9 + 7. Two paths are considered different if there is at least one cell that is visited in one path, but not visited in the other.

Input

The first line contains two integers n, m — dimensions of the labyrinth (1 ≤ n, m ≤ 2000).

Next n lines describe the labyrinth. Each of these lines contains m characters. The j-th character of the i-th of these lines is equal to "R" if the cell (i, j) contains a rock, or "." if the cell (i, j) is empty.

It is guaranteed that the starting cell (1, 1) is empty.

Output

Print a single integer — the number of different legal paths from (1, 1) to (n, m) modulo 10^9 + 7.

Examples

Input


1 1
.


Output


1


Input


2 3
...
..R


Output


0


Input


4 4
...R
.RR.
.RR.
R...


Output


4

Note

In the first sample case we can't (and don't have to) move, hence the only path consists of a single cell (1, 1).

In the second sample case the goal is blocked and is unreachable.

Illustrations for the third sample case can be found here: <https://assets.codeforces.com/rounds/1225/index.html>
#include <bits/stdc++.h>
#pragma GCC optimize(2)
const int inf = 0x3f3f3f3f, Inf = 0x7fffffff;
const long long INF = 0x7fffffffffffffff;
const double eps = 1e-8;
unsigned int seed = 19260817;
const unsigned int _RAND_MAX_ = 4294967295u;
__inline__ __attribute__((always_inline)) unsigned int Rand() {
  return seed = seed * 998244353u + 1000000007u;
}
template <typename _Tp>
_Tp gcd(const _Tp &a, const _Tp &b) {
  return (!b) ? a : gcd(b, a % b);
}
template <typename _Tp>
__inline__ __attribute__((always_inline)) _Tp abs(const _Tp &a) {
  return a > 0 ? a : -a;
}
template <typename _Tp>
__inline__ __attribute__((always_inline)) _Tp max(const _Tp &a, const _Tp &b) {
  return a < b ? b : a;
}
template <typename _Tp>
__inline__ __attribute__((always_inline)) _Tp min(const _Tp &a, const _Tp &b) {
  return a < b ? a : b;
}
template <typename _Tp>
__inline__ __attribute__((always_inline)) void chmax(_Tp &a, const _Tp &b) {
  (a < b) && (a = b);
}
template <typename _Tp>
__inline__ __attribute__((always_inline)) void chmin(_Tp &a, const _Tp &b) {
  (a > b) && (a = b);
}
template <typename _Tp>
__inline__ __attribute__((always_inline)) bool _cmp(const _Tp &a,
                                                    const _Tp &b) {
  return abs(a - b) <= eps;
}
template <typename _Tp>
__inline__ __attribute__((always_inline)) void read(_Tp &x) {
  register char ch(getchar());
  bool f(false);
  while (ch < 48 || ch > 57) f |= ch == 45, ch = getchar();
  x = ch & 15, ch = getchar();
  while (ch >= 48 && ch <= 57)
    x = (((x << 2) + x) << 1) + (ch & 15), ch = getchar();
  if (f) x = -x;
}
template <typename _Tp, typename... Args>
__inline__ __attribute__((always_inline)) void read(_Tp &t, Args &...args) {
  read(t);
  read(args...);
}
__inline__ __attribute__((always_inline)) int read_str(char *s) {
  register char ch(getchar());
  while (ch == ' ' || ch == '\r' || ch == '\n') ch = getchar();
  register char *tar = s;
  *tar = ch, ch = getchar();
  while (ch != ' ' && ch != '\r' && ch != '\n' && ch != EOF)
    *(++tar) = ch, ch = getchar();
  return tar - s + 1;
}
const int N = 2005;
const int mod = 1000000007;
char s[N][N];
int dp[N][N];
int cnt1[N][N], cnt2[N][N];
__inline__ __attribute__((always_inline)) void _add(int &A, const int &B) {
  (A += B) >= mod && (A -= mod);
}
__inline__ __attribute__((always_inline)) void _sub(int &A, const int &B) {
  (A -= B) < 0 && (A += mod);
}
struct BIT {
  int c[N];
  __inline__ __attribute__((always_inline)) void add(int x, const int &C) {
    for (; x <= 2000; x += ((x) & (-x))) {
      _add(c[x], C);
    }
  }
  __inline__ __attribute__((always_inline)) void sub(int x, const int &C) {
    for (; x <= 2000; x += ((x) & (-x))) {
      _sub(c[x], C);
    }
  }
  __inline__ __attribute__((always_inline)) int sum(int x) {
    int ans = 0;
    for (; x; x -= ((x) & (-x))) {
      _add(ans, c[x]);
    }
    return ans;
  }
} tr1[N], tr2[N];
__inline__ __attribute__((always_inline)) void Upd1(int x, int l, int r,
                                                    const int &C) {
  tr1[x].add(l, C);
  tr1[x].sub(r + 1, C);
}
__inline__ __attribute__((always_inline)) void Upd2(int x, int l, int r,
                                                    const int &C) {
  tr2[x].add(l, C);
  tr2[x].sub(r + 1, C);
}
int main() {
  int n, m;
  read(n, m);
  if (n == 1 && m == 1) {
    printf("1\n");
    return 0;
  }
  for (int i = 1; i <= n; ++i) {
    read_str(s[i] + 1);
    int cnt = 0;
    for (int j = 1; j <= m; ++j) {
      cnt += s[i][j] == 'R';
      cnt1[i][j] = cnt;
    }
  }
  for (int i = 1; i <= m; ++i) {
    int cnt = 0;
    for (int j = 2; j <= n; ++j) {
      cnt += s[j][i] == 'R';
      cnt2[j][i] = cnt;
    }
  }
  Upd1(1, 1, 1, 1);
  Upd2(1, 1, 1, 1);
  int a = 0, b = 0;
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) {
      a = tr1[i].sum(j);
      b = tr2[j].sum(i);
      int sum = cnt2[n][j] - cnt2[i][j];
      Upd2(j, i + 1, n - sum, a);
      sum = cnt1[i][m] - cnt1[i][j];
      Upd1(i, j + 1, m - sum, b);
    }
  }
  _add(a, b);
  printf("%d\n", a);
  return 0;
}
