You are at the top left cell $(1, 1)$ of an $n \times 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 \leq n, m \leq 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

```python

USER_FILENAME = "<user_code>"
import sys, json, builtins
import math, heapq, bisect, itertools, functools, collections, statistics, fractions, decimal, operator, array, random, re, string, os, pathlib
try:
    import resource as _res
except Exception:
    _res = None
from collections import Counter, defaultdict, deque, OrderedDict
from functools import lru_cache, reduce
from itertools import accumulate, permutations, combinations, product
from math import gcd, ceil, floor, sqrt
from decimal import Decimal
try:
    from typing import *
except Exception:
    pass
try:
    sys.setrecursionlimit(1_000_000)
except Exception:
    pass
try:
    import site as _site
    try:
        _sys_sites = _site.getsitepackages() if hasattr(_site, "getsitepackages") else []
        for _p in _sys_sites:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
    try:
        _usp = _site.getusersitepackages()
        if isinstance(_usp, str):
            _usp = [_usp]
        for _p in _usp:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
except Exception:
    pass

ns = {"__name__": "__main__"}
for _k, _v in list(globals().items()):
    if not _k.startswith("_"):
        ns[_k] = _v
_CODE = "def getSum(dp, pos, s, e, type_):\n    if e < s:\n        return 0\n           \n    if type_=='D':\n        if e==m-1:\n            return dp[pos][s]\n        return dp[pos][s]-dp[pos][e+1]\n    else:\n        if e==n-1:\n            return dp[s][pos]\n        return dp[s][pos]-dp[e+1][pos]\n\nmod  = 10**9+7\nn, m = map(int, input().split())\na    = [list(list(map(lambda x: 1 if x=='R' else 0, input()))) for _ in range(n)] \n\nSD  = [[0]*m for _ in range(n)]\nSN  = [[0]*m for _ in range(n)]\ndpD = [[0]*m for _ in range(n)]\ndpN = [[0]*m for _ in range(n)]\n\nfor i in range(n-1, -1, -1):\n    for j in range(m-1, -1, -1):\n        if i == n-1:\n            SD[i][j]=a[i][j] \n        else:\n            SD[i][j]=SD[i+1][j]+a[i][j]\n\n        if j == m-1:\n            SN[i][j]=a[i][j]\n        else:    \n            SN[i][j]=SN[i][j+1]+a[i][j]\n            \nfor j in range(m-1,-1,-1):\n    if a[n-1][j]==1:\n        break\n    dpD[n-1][j]=1\n    dpN[n-1][j]=1\n    \nfor i in range(n-1,-1,-1):\n    if a[i][m-1]==1:\n        break\n    dpD[i][m-1]=1\n    dpN[i][m-1]=1\n    \nfor j in range(m-2, -1, -1):\n    if i==n-1:\n        break\n    dpD[n-1][j]+=dpD[n-1][j+1]\n    \nfor i in range(n-2,-1,-1):    \n    if j==m-1:\n        break\n    dpN[i][m-1]+=dpN[i+1][m-1]       \n    \nfor i in range(n-2,-1,-1):\n    for j in range(m-2,-1,-1):\n        s, e = j, m-SN[i][j]-1\n        #print(i, j, s, e, 'N')\n        dpN[i][j]  = getSum(dpD, i+1, s, e, 'D')\n        dpN[i][j]  = (dpN[i][j] + dpN[i+1][j]) % mod    \n    \n        s, e = i, n-SD[i][j]-1\n        #print(i, j, s, e, 'D')\n        dpD[i][j]  = getSum(dpN, j+1, s, e, 'N')\n\n    if i != 0:\n        for j in range(m-2,-1,-1):        \n            dpD[i][j] = (dpD[i][j] + dpD[i][j+1]) % mod    \n                        \nprint(dpD[0][0] % mod)            "
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 14699