object Main extends App {
    val ary = scala.io.StdIn.readLine().split(" ")
    val l1 = List(1,3,5,7,8,10,12)
    val l2 = List(4,6,9,11)
    val l3 = List(2)
    val a = ary(0).toInt
    val b = ary(1).toInt
    
    if (isExist(l1,a,b) || isExist(l2,a,b) || isExist(l3,a,b)) {
        println("Yes")
    } else {
        println("No")
    }

    def isExist(list: List[Int], a: Int, b: Int): Boolean =
        list.exists(_==a) && list.exists(_==b)
}
