main = do
    [x, y] <- map read . words <$> getLine
    putStrLn $ if grouping x == grouping y then "Yes" else "No"

grouping n
    | n == 2                    = 0
    | n `elem` [4, 6, 9, 11]    = 1
    | otherwise                 = 2