object Main extends App {

  import scala.io.StdIn._

  val mod: Long = 1000000007l
  val Array(h, w) = readLine.trim.split(' ').map(_.toInt)
  val state = Array.tabulate(h){_ ⇒ readLine.trim.map(_ == '.').toArray}
  val counts = Array.tabulate(h){_ ⇒ Array.tabulate(w){_ ⇒ 0L}}.also{arr ⇒ arr(0)(0) = 1L}
  for {i ← 0 until h
       j ← 0 until w}{
      if (i + 1 < h && state(i + 1)(j)){
        counts(i + 1)(j) = (counts(i + 1)(j) + counts(i)(j)) % mod
      }
      if (j + 1 < w && state(i)(j + 1)){
        counts(i)(j + 1) = (counts(i)(j + 1) + counts(i)(j)) % mod
      }
  }
  println(counts.last.last)

  implicit class Extend[T](value: T){
    def also(func: T ⇒ Unit): T = {func(value); value}
    def let[A](func: T ⇒ A): A = func(value)
  }
}