There is a grid with H horizontal rows and W vertical columns. Let (i, j) denote the square at the i-th row from the top and the j-th column from the left.  For each i and j (1 \leq i \leq H, 1 \leq j \leq W), Square (i, j) is described by a character a_{i, j}. If a_{i, j} is `.`, Square (i, j) is an empty square; if a_{i, j} is `#`, Square (i, j) is a wall square. It is guaranteed that Squares (1, 1) and (H, W) are empty squares.  Taro will start from Square (1, 1) and reach (H, W) by repeatedly moving right or down to an adjacent empty square.  Find the number of Taro's paths from Square (1, 1) to (H, W). As the answer can be extremely large, find the count modulo 10^9 + 7.
H, W = map(int, input().split())
gridlist = [list(input()) for i in range(H)]

for each in gridlist:
    print(each)

matrix = [[1]*W for i in range(H)]

print(matrix)
for i in range(H):
    for j in range(W):
        if gridlist[i][j] == '#':
            matrix[i][j] = 0

# print(matrix)

for i in range(H):
    for j in range(W):
        up = 0
        left = 0
        if matrix[i][j] == 0:
            continue
        if i==0 and j == 0:
            continue
        if i > 0:
            left = matrix[i-1][j]
        if j > 0:
            up = matrix[i][j-1]
        matrix[i][j] = left + up
        # print(matrix)

print(matrix[i][j])






H, W = map(int, input().split())
gridlist = [list(input()) for i in range(H)]

matrix = [[1]*W for i in range(H)]

# print(matrix)
for i in range(H):
    for j in range(W):
        if gridlist[i][j] == '#':
            matrix[i][j] = 0

# print(matrix)

for i in range(H):
    for j in range(W):
        up = 0
        left = 0
        if matrix[i][j] == 0:
            continue
        if i==0 and j == 0:
            continue
        if i > 0:
            left = matrix[i-1][j]
        if j > 0:
            up = matrix[i][j-1]
        matrix[i][j] = left + up
        # print(matrix)

print(matrix[i][j] % (10**9 + 7))





