module Main where

import           Control.Monad
import           Data.List
import           Data.List.Split
import           Data.Array.IO
import qualified Data.Vector as V

main :: IO ()
main = do
  as <- map read . words <$> getLine :: IO [Int]
  if (length . group) as == 1
    then putStr "Yes"
    else putStr "No"