mod = 10**9 + 7

H, W = list(map(int, input().split()))

Maze = [[0]*(W+1) for _ in range(H+1)]

Memo = [[0]*(W+1) for _ in range(H+1)]

Memo[H-1][W-1] = 1

for i in range(H):

    S = eval(input())

    for j in range(W):

        Maze[i][j] = S[j]



for a in range(H-1, -1, -1):

    for b in range(W-1, -1, -1):

        if Maze[a][b] == '#':

            Memo[a][b] = 0

        elif (a == H-1) and (b == W-1):

            continue

        else:

            Memo[a][b] = Memo[a+1][b] + Memo[a][b+1]

            Memo[a][b] %= mod

print((Memo[0][0]))

H, W = list(map(int, input().split()))

S = [[a for a in eval(input())] for _ in range(H)]

mod = 10 ** 9 + 7

DP = [[0] * (W + 1) for _ in range(H+1)]

DP[1][1] = 1

for i in range(1, H+1):

    for j in range(1, W+1):

        if S[i-1][j-1] == '#':

            continue

        if i == 1 and j == 1:

            continue

        DP[i][j] = DP[i - 1][j] + DP[i][j - 1]

        DP[i][j] %= mod



print((DP[-1][-1]))

mod = 10**9 + 7
H, W = list(map(int, input().split()))
Maze = [[0] * (W + 1) for _ in range(H + 1)]
Memo = [[0] * (W + 1) for _ in range(H + 1)]
Memo[H - 1][W - 1] = 1
for i in range(H):
    S = eval(input())
    for j in range(W):
        Maze[i][j] = S[j]
for a in range(H - 1, -1, -1):
    for b in range(W - 1, -1, -1):
        if Maze[a][b] == "#":
            Memo[a][b] = 0
        elif (a == H - 1) and (b == W - 1):
            continue
        else:
            Memo[a][b] = Memo[a + 1][b] + Memo[a][b + 1]
            Memo[a][b] %= mod
print((Memo[0][0]))

H, W = list(map(int, input().split()))
S = [[a for a in eval(input())] for _ in range(H)]
mod = 10**9 + 7
DP = [[0] * (W + 1) for _ in range(H + 1)]
DP[1][1] = 1
for i in range(1, H + 1):
    for j in range(1, W + 1):
        if S[i - 1][j - 1] == "#":
            continue
        if i == 1 and j == 1:
            continue
        DP[i][j] = DP[i - 1][j] + DP[i][j - 1]
        DP[i][j] %= mod
print((DP[-1][-1]))

+H, W = list(map(int, input().split())) +S = [[a for a in eval(input())] for _ in range(H)] -H, W = list(map(int, input().split())) -Maze = [[0] * (W + 1) for _ in range(H + 1)] -Memo = [[0] * (W + 1) for _ in range(H + 1)] -Memo[H - 1][W - 1] = 1 -for i in range(H): -    S = eval(input()) -    for j in range(W): -        Maze[i][j] = S[j] -for a in range(H - 1, -1, -1): -    for b in range(W - 1, -1, -1): -        if Maze[a][b] == "#": -            Memo[a][b] = 0 -        elif (a == H - 1) and (b == W - 1): +DP = [[0] * (W + 1) for _ in range(H + 1)] +DP[1][1] = 1 +for i in range(1, H + 1): +    for j in range(1, W + 1): +        if S[i - 1][j - 1] == "#": -        else: -            Memo[a][b] = Memo[a + 1][b] + Memo[a][b + 1] -            Memo[a][b] %= mod -print((Memo[0][0])) +        if i == 1 and j == 1: +            continue +        DP[i][j] = DP[i - 1][j] + DP[i][j - 1] +        DP[i][j] %= mod +print((DP[-1][-1]))