let mod = 1000000007
let input = readLine()!.split(separator: " ").map { Int($0)! }

let H = input[0]
let W = input[1]

var grid: [[Character]] = .init(repeating: .init(repeating: "@", count: W), count: H)

for h in 0..<H {
  grid[h] = Array(readLine()!)
}

var dp: [[Int]] = .init(repeating: .init(repeating: 0, count: W + 1), count: H + 1)
dp[0][0] = 1
for row in 1...H {
  for col in 1...W {
    if grid[row - 1][col - 1] == "#" {
      dp[row][col] = 0
      continue
    }
    if row == 1 && col == 1 {
      dp[row][col] = 1
      continue
    }
    dp[row][col] = (dp[row - 1][col] + dp[row][col-1]) % mod
  }
}
print(dp[H][W])