import java.util.*

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


