fun main(args: Array<String>) {
    val xy = readLine()!!.split(" ").map{it.toInt()}.toList()
    val groupA = listOf(1,3,5,7,8,10,12)
    val groupB = listOf(4,6,9,11)
    val groupC = listOf(2)
    if(groupA.containsAll(xy) || groupB.containsAll(xy)|| groupC.containsAll(xy) ){
        println("Yes")
    }else{
        println("No")
    }
}