object Main {

  def main(args: Array[String]): Unit = {
    val sc = new java.util.Scanner(System.in)

    val X, Y = sc.nextInt()
    val dp = Array.fill(Y+1, X+1)(0L)
    dp(0)(0) = 1L
    for {
      y <- 0 until Y
      x <- 0 until X
    } {
      if (x < X - 1) dp(y+1)(x+2) += dp(y)(x)
      if (y < Y - 1) dp(y+2)(x+1) += dp(y)(x)
    }
    println(dp(Y)(X))
  }

}