import sys

sys.setrecursionlimit(10**6)

h, w = list(map(int, input().split()))



field = [list(eval(input())) for _ in range(h)]



dp = [[None] * w for _ in range(h)]

def dfs(hindex=h - 1, windex=w - 1):

    if field[hindex][windex] == "#":

        return 0

    if hindex == windex == 0:

        return 1



    if dp[hindex][windex] is not None:

        return dp[hindex][windex]

    r = (hindex and dfs(hindex - 1, windex)) + (windex and dfs(hindex, windex - 1))

    dp[hindex][windex] = r

    return r



print((dfs() % (10**9 + 7)))

import sys

sys.setrecursionlimit(10**6)

h, w = list(map(int, input().split()))



field = [list(eval(input())) for _ in range(h)]



dp = [[None] * w for _ in range(h)]

# def dfs(hindex=h - 1, windex=w - 1):

#     if field[hindex][windex] == "#":

#         return 0

#     if hindex == windex == 0:

#         return 1

#

#     if dp[hindex][windex] is not None:

#         return dp[hindex][windex]

#     r = (hindex and dfs(hindex - 1, windex)) + (windex and dfs(hindex, windex - 1))

#     dp[hindex][windex] = r

#     return r

#

# print(dfs() % (10**9 + 7))



for hindex in range(h):

    for windex in range(w):

        if hindex == windex == 0:

            dp[hindex][windex] = 1

        elif field[hindex][windex] == "#":

            dp[hindex][windex] = 0

        else:

            dp[hindex][windex] = (hindex and dp[hindex - 1][windex]) + (windex and dp[hindex][windex - 1])

print((dp[hindex][windex] % (10**9 + 7)))

import sys

sys.setrecursionlimit(10**6)
h, w = list(map(int, input().split()))
field = [list(eval(input())) for _ in range(h)]
dp = [[None] * w for _ in range(h)]


def dfs(hindex=h - 1, windex=w - 1):
    if field[hindex][windex] == "#":
        return 0
    if hindex == windex == 0:
        return 1
    if dp[hindex][windex] is not None:
        return dp[hindex][windex]
    r = (hindex and dfs(hindex - 1, windex)) + (windex and dfs(hindex, windex - 1))
    dp[hindex][windex] = r
    return r


print((dfs() % (10**9 + 7)))

import sys

sys.setrecursionlimit(10**6)
h, w = list(map(int, input().split()))
field = [list(eval(input())) for _ in range(h)]
dp = [[None] * w for _ in range(h)]
# def dfs(hindex=h - 1, windex=w - 1):
#     if field[hindex][windex] == "#":
#         return 0
#     if hindex == windex == 0:
#         return 1
#
#     if dp[hindex][windex] is not None:
#         return dp[hindex][windex]
#     r = (hindex and dfs(hindex - 1, windex)) + (windex and dfs(hindex, windex - 1))
#     dp[hindex][windex] = r
#     return r
#
# print(dfs() % (10**9 + 7))
for hindex in range(h):
    for windex in range(w):
        if hindex == windex == 0:
            dp[hindex][windex] = 1
        elif field[hindex][windex] == "#":
            dp[hindex][windex] = 0
        else:
            dp[hindex][windex] = (hindex and dp[hindex - 1][windex]) + (
                windex and dp[hindex][windex - 1]
            )
print((dp[hindex][windex] % (10**9 + 7)))

- - -def dfs(hindex=h - 1, windex=w - 1): -    if field[hindex][windex] == "#": -        return 0 -    if hindex == windex == 0: -        return 1 -    if dp[hindex][windex] is not None: -        return dp[hindex][windex] -    r = (hindex and dfs(hindex - 1, windex)) + (windex and dfs(hindex, windex - 1)) -    dp[hindex][windex] = r -    return r - - -print((dfs() % (10**9 + 7))) +# def dfs(hindex=h - 1, windex=w - 1): +#     if field[hindex][windex] == "#": +#         return 0 +#     if hindex == windex == 0: +#         return 1 +# +#     if dp[hindex][windex] is not None: +#         return dp[hindex][windex] +#     r = (hindex and dfs(hindex - 1, windex)) + (windex and dfs(hindex, windex - 1)) +#     dp[hindex][windex] = r +#     return r +# +# print(dfs() % (10**9 + 7)) +for hindex in range(h): +    for windex in range(w): +        if hindex == windex == 0: +            dp[hindex][windex] = 1 +        elif field[hindex][windex] == "#": +            dp[hindex][windex] = 0 +        else: +            dp[hindex][windex] = (hindex and dp[hindex - 1][windex]) + ( +                windex and dp[hindex][windex - 1] +            ) +print((dp[hindex][windex] % (10**9 + 7)))