import Data.Sequence (fromList, index)

g = fromList [0, 1, 3, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1]

solve [a, b] = if (g `index` a) == (g `index` b) then "Yes" else "No"

main = interact $ solve . map read . words