function main (s) {
    s=s.split(" ");
	s[0]=parseInt(s[0]);
	s[1]=parseInt(s[1]);
	var g=[1,3,1,2,1,2,1,1,2,1,2,1];
	console.log((g[s[0]-1]==g[s[1]-1])?"Yes\n":"No\n");
}
 
main(require('fs').readFileSync('/dev/stdin', 'utf8'));