master_streets = []
for i in 0..2 do
  master_streets.push(gets.chomp.split(" ").map(&:to_i))
end

travel_flag = true
master_streets.flatten.sort.each{ |street|
  count =0
  master_streets.flatten.sort.each{ |comp_street|
    count += 1 if  street == comp_street
  }
  if count > 2
    travel_flag = false
  end
}
if travel_flag
  print("YES\n")
else
  print("NO\n")
end