h,w = gets.split.map(&:to_i)
dp = Array.new(h+1).map{Array.new(w+1,0)}
dp[0][0] = 1
mod = 10**9+7
for i in 0..h-1
    a = gets.chomp
    for j in 0..w-1
        next if a[j] == "#"
        dp[i][j] %= mod
        dp[i+1][j] += dp[i][j]
        dp[i][j+1] += dp[i][j]
    end
end
puts dp[h-1][w-1]%mod