{-# LANGUAGE OverloadedStrings #-}

import           Data.Char
import qualified Data.ByteString.Char8 as B
import qualified Data.Vector.Unboxed   as U
import qualified Data.IntMap           as M

main :: IO ()
main = do
  abs <- U.unfoldrN 6 (B.readInt . B.dropWhile isSpace) <$> B.getContents
  B.putStrLn $ if solve abs then "YES" else "NO"

solve :: U.Vector Int -> Bool
solve = (<= 2) . M.size . M.filter odd  . U.foldr (\k mp -> M.insertWith (+) k 1 mp) M.empty