fun main(args:Array<String>) {
	val (x,y) = readLine()!!.split(" ").map {it.toInt()}
	val g1= listOf(1,3,5,7,8,10,12)
	val g2= listOf(4,6,9,11)
	val g3= listOf(2)
	
	when{
	    x in g1 && y in g1 -> println("Yes")
	    x in g2 && y in g2 -> println("Yes")
	    x in g3 && y in g3 -> println("Yes")
		else -> println("No")
	}
	
}