object MainKt {
  @JvmStatic fun main(args:Array<String>) {
    val (x,y) = readLine()!!.split(" ").map(String::toInt)

    val a=arrayOf(1,3,5,7,8,10,12)
    val b=arrayOf(4,6,9,11)

    println(if(x==y) {
      "Yes"
    } else {
      when {
        x in a && y in a -> "Yes"
        x in b && y in b -> "Yes"
        else -> "No"
      }
    })
  }
}
