frag = 'No'
s = [0,0,0,0]
3.times do 
  a,b = gets.split(" ").map!{|i| i.to_i}
  if a == 1 then s[0] += 1 end
  if a == 2 then s[1] += 1 end
 if a == 3 then s[2] += 1 end
 if a == 4 then s[3] += 1 end
 if b == 1 then s[0] += 1 end
  if b == 2 then s[1] += 1 end
 if b == 3 then s[2] += 1 end
 if b == 4 then s[3] += 1 end
end 
if s == [1,1, 2, 2] or s == [1, 2, 2, 1] or s == [2, 2 , 1, 1] or s == [2, 1, 2, 1] or s == [2, 1, 1, 2] or s == [1, 2, 1,2 ] 
 puts 'YES'
else puts 'NO'
end
