MOD = 10**9+7

h,w = gets.split.map(&:to_i)
a = Array.new(h){ gets.chomp }

dp = Array.new(h){ Array.new(w, 0) }
dp[0][0] = 1

h.times do |i|
  w.times do |j|
    next if a[i][j] == "#"
    if i + 1 < h
      dp[i+1][j] += dp[i][j]
      dp[i+1][j] %= MOD
    end

    if j + 1 < w
      dp[i][j+1] += dp[i][j]
      dp[i][j+1] %= MOD
    end
  end
end

p dp[-1][-1]