local h,w=io.read("n","n","l")
local a={}
for i=1,h do
    local input=io.read()
    a[i]={}
    for j=1,w do
        a[i][j]=input:byte(j)
    end
end

local dp={}
for i=1,h do
    dp[i]={}
    for j=1,w do
        dp[i][j]=0
    end
end
dp[1][1]=1

local mod=1000000007
for i=1,h do
    for j=1,w do
        if i<h and a[i+1][j]==46 then
            dp[i+1][j]=(dp[i+1][j]+dp[i][j])%mod
        end
        if j<w and a[i][j+1]==46 then
            dp[i][j+1]=(dp[i][j+1]+dp[i][j])%mod
        end
    end
end
print(dp[h][w])