fun contains(numbers: IntArray, x: Int, y: Int): Boolean {
    var hasX = false
    var hasY = false

    for (number: Int in numbers) {
        hasX = (hasX || number == x)
        hasY = (hasY || number == y)
    }

    return (hasX && hasY)
}

fun containsInArray(numbersArray: Array<IntArray>, x: Int, y: Int): Boolean {
    var has = false

    for (numbers: IntArray in numbersArray) {
        if (contains(numbers, x, y)) {
            has = true
            break
        }
    }

    return has
}


fun main(args: Array<String>) {
    val (x, y) = readLine()!!.split(' ').map(String::toInt)
    val numbersArray: Array<IntArray> = arrayOf(intArrayOf(1, 3, 5, 7, 8, 10, 12), intArrayOf(4, 6, 9, 11), intArrayOf(2))

    val result = if (containsInArray(numbersArray, x, y)) "Yes" else "No"
    println(result)
}