fun main(args: Array<String>) {
    val a = intArrayOf(1, 3, 5, 7, 8, 10, 12)
    val b = intArrayOf(4, 6, 9, 11)
    val (x, y) = readLine()!!.split(' ').map(String::toInt)
    println(if ((x == 2 && y == 2) || (x in a && y in a) || (x in b && y in b)) "Yes" else "No")
}
