'use strict'

const main = input => {
	const args = input.split('\n').map(arg => arg.split(' '))
	const x = parseInt(args[0][0], 10)
	const y = parseInt(args[0][1], 10)
	const group1 = [1, 3, 5, 7, 8, 10, 12]
	const group2 = [4, 6, 9, 11]

	let f1 = false 
	let f2 = false

	for (let i = 0; i < group1.length; i++) {
		if (x === group1[i]) f1 = true 
		if (y === group1[i]) f2 = true
	}

	let f3 = false 
	let f4 = false

	for (let i = 0; i < group2.length; i++) {
		if (x === group2[i]) f3 = true 
		if (y === group2[i]) f4 = true
	}

	if (f1 && f2) console.log('Yes')
	else if (f3 && f4) console.log('Yes')
	else console.log('No')
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'))
