Y = [-1, 0]; X = [0, -1]
H, W = gets.split.map(&:to_i)
areas = []
H.times do
  areas << gets.chomp.split('')
end
dp = Array.new(H+1){Array.new(W+1, 0)}
dp[H-1][W-1] = 1
(H-1).downto(0) do |i|
  (W-1).downto(0) do |j|
    next if (i == H-1 && j == W-1) || areas[i][j] == "#"
    dp[i][j] = dp[i+1][j] + dp[i][j+1]
  end
end
puts dp[0][0] % (10**9 + 7)