import java.io._
import java.util.StringTokenizer
import scala.util.control.Breaks.{breakable,break}

object Main extends App {
  val in = new InputReader(System.in)
  val pw = new PrintWriter(System.out)

  val MOD = 1e9.toInt + 7

  val H, W = in.next().toInt
  val a = new Array[String](H+1)
  for (i <- 1 to H)
    a(i) = "#" + in.next()

  //
  val dp = Array.ofDim[Long](H+1, W+1)
  dp(1)(1) = 1
  for (y <- 1 to H; x <- 1 to W if x != 1 || y != 1) {
    if(a(y)(x) == '#')
      dp(y)(x) = 0
    else {
      dp(y)(x) = dp(y-1)(x) + dp(y)(x-1)
      dp(y)(x) %= MOD
    }
  }

  println(dp(H)(W))
}


class InputReader(stream: InputStream) {
  private val reader = new BufferedReader(new InputStreamReader(stream))
  private var tokenizer: StringTokenizer = new StringTokenizer(reader.readLine())
  def next(): String = {
    while (!tokenizer.hasMoreTokens()) {
      tokenizer = new StringTokenizer(reader.readLine())
    }
    tokenizer.nextToken()
  }
}

