main :: IO ()
main = do
  ss <- words <$> getLine :: IO [String]
  let is = map read ss :: [Int]
  if test is then
      putStrLn "YES"
  else
      putStrLn "NO"
      where test = cmpsm . concat . map spl . rot 
  
  
cmpsm :: [([Int], [Int])] -> Bool
cmpsm = foldr (\t b -> ((sum $ fst t) == (sum $ snd t)) || b) False

spl :: [Int] -> [([Int], [Int])]
spl []  = []
spl [_] = []
spl (x:xs)  = ([x], xs) : [(x:ls,rs) | (ls,rs) <- spl xs]

rot :: [Int] -> [[Int]]
rot xs = [(drop i xs) ++ (take i xs) | i <- [1..length xs]]
