import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val month = arrayOf(0, 2, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0)
    val x = sc.nextInt() - 1
    val y = sc.nextInt() - 1
    println(if (month[x] == month[y]) "Yes" else "No")
}