fun main(arr:Array<String>) {
    val dic = mutableMapOf<Int, Int>()
    listOf(1,3,5,8,7,10,12).forEach { dic[it] = 0 }
    listOf(4,6,9,11).forEach { dic[it] = 1 }
    dic[2] = 2

    val xy = readLine()!!.split(" ").map { it.toInt() }
    val ans = if(xy.map { dic[it]!! }.distinct().size == 1) "Yes" else "No"
    println(ans)
}