MOD = 10 ** 9 + 7
H, W = gets.split.map(&:to_i)
data = H.times.map{gets.chomp.split("")}

#H, W = 1000,1000
#data = H.times.map{("." * W).split("")}

dp = Array.new(H){Array.new(W, 0)}
dp[0][0] = 1
H.times do |i|
  W.times do |j|
    next if data[i][j] == '#'
    [[0,1],[1,0]].each do |h, w|
      ni, nj = i + h, j + w
      next if ni < 0 || nj < 0 || ni > H - 1 || nj > W - 1
      dp[ni][nj] += dp[i][j]
      dp[ni][nj] %= MOD
    end
  end
end

p dp.last.last % MOD