import qualified Data.Vector.Unboxed as V
main = do
    (a1:b1:_)<-map read.words<$>getLine::IO [Int]
    (a2:b2:_)<-map read.words<$>getLine::IO [Int]
    (a3:b3:_)<-map read.words<$>getLine::IO [Int]
    putStrLn $ if f [(a1,b1), (a2,b2), (a3,b3)] then "YES" else "NO"

f :: [(Int,Int)] -> Bool
f abs = (\n->n==2 || n== 0) $ V.length $ V.filter odd va
    where
        va = V.accum (+) (V.replicate 4 (0::Int)) $ concatMap (\(a,b)->[(a-1,1),(b-1,1)]) abs
