import sys

readline = sys.stdin.buffer.readline

# ord('.') == 46



def main():

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

    a = readline()

    k = a.find(b'#')

    if k == -1:

        k = W

    v = [1] * k + [0] * (W - k)

    u = [0] * W



    for _ in range(1, H):

        a = readline()

        u, v = v, u

        v[0] = t = u[0] if a[0] == 46 else 0

        for j, uu, aa in zip(list(range(1, W)), u[1:], a[1:]):

            v[j] = t = uu + t if aa == 46 else 0

    print((v[-1] % (10 ** 9 + 7)))





main()

import sys

readline = sys.stdin.buffer.readline

# ord('.') == 46



def main():

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

    a = readline()

    k = a.find(b'#')

    if k == -1:

        k = W

    v = [1] * k + [0] * (W - k)



    for m in range(1, H):

        a = readline()

        v[0] = t = v[0] if a[0] == 46 else 0

        if m % 80 == 0:

            for j, u, aa in zip(list(range(1, W)), v[1:], a[1:W]):

                v[j] = t = (u + t) % 1000000007 if aa == 46 else 0

        else:

            for j, u, aa in zip(list(range(1, W)), v[1:], a[1:W]):

                v[j] = t = (u + t) if aa == 46 else 0

    print((v[-1] % 1000000007))





main()

import sys

readline = sys.stdin.buffer.readline
# ord('.') == 46
def main():
    H, W = list(map(int, readline().split()))
    a = readline()
    k = a.find(b"#")
    if k == -1:
        k = W
    v = [1] * k + [0] * (W - k)
    u = [0] * W
    for _ in range(1, H):
        a = readline()
        u, v = v, u
        v[0] = t = u[0] if a[0] == 46 else 0
        for j, uu, aa in zip(list(range(1, W)), u[1:], a[1:]):
            v[j] = t = uu + t if aa == 46 else 0
    print((v[-1] % (10**9 + 7)))


main()

import sys

readline = sys.stdin.buffer.readline
# ord('.') == 46
def main():
    H, W = list(map(int, readline().split()))
    a = readline()
    k = a.find(b"#")
    if k == -1:
        k = W
    v = [1] * k + [0] * (W - k)
    for m in range(1, H):
        a = readline()
        v[0] = t = v[0] if a[0] == 46 else 0
        if m % 80 == 0:
            for j, u, aa in zip(list(range(1, W)), v[1:], a[1:W]):
                v[j] = t = (u + t) % 1000000007 if aa == 46 else 0
        else:
            for j, u, aa in zip(list(range(1, W)), v[1:], a[1:W]):
                v[j] = t = (u + t) if aa == 46 else 0
    print((v[-1] % 1000000007))


main()

-    u = [0] * W -    for _ in range(1, H): +    for m in range(1, H): -        u, v = v, u -        v[0] = t = u[0] if a[0] == 46 else 0 -        for j, uu, aa in zip(list(range(1, W)), u[1:], a[1:]): -            v[j] = t = uu + t if aa == 46 else 0 -    print((v[-1] % (10**9 + 7))) +        v[0] = t = v[0] if a[0] == 46 else 0 +        if m % 80 == 0: +            for j, u, aa in zip(list(range(1, W)), v[1:], a[1:W]): +                v[j] = t = (u + t) % 1000000007 if aa == 46 else 0 +        else: +            for j, u, aa in zip(list(range(1, W)), v[1:], a[1:W]): +                v[j] = t = (u + t) if aa == 46 else 0 +    print((v[-1] % 1000000007))