h,w = gets.split.map(&:to_i)
squares = []
h.times do
  squares << gets.chomp.split("")
end
dp = Array.new(h){[1]*w}

squares.each_with_index do |line,i|
  line.each_with_index do |a,j|
    dp[i][j] = 0 if i == 0 && j > 0 && dp[i][j-1] == 0
    dp[i][j] = 0 if j == 0 && i > 0 && dp[i-1][j] == 0
    if a == "#"
      dp[i][j] = 0
      next
    end
    next if i == 0 || j == 0
    dp[i][j] = dp[i-1][j] + dp[i][j-1]
  end
end
p dp[h-1][w-1] % (10**9+7)
