main = getLine >>= putStrLn . solve . map read . words

solve :: [Int] -> String
solve [x, y] =
	if x == 4 || x == 6 || x == 9 || x == 11 then 
    	(if y == 4 || y == 6 || y == 9 || y == 11 then "Yes" else "No")
    else if x == 2 then
    	(if y == 2 then "Yes" else "No")
    else
    	(if y == 2 || y == 4 || y == 6 || y == 9 || y == 11 then "No" else "Yes")