require 'pp'
paths = [[], [], [], []]
3.times do |i|
  a,b = readline.chomp.split.map(&:to_i).map {|x| x-1}
  paths[a].push(b)
  paths[b].push(a)
end

ks = paths.map {|a| a.size }.sort

if ks == [1,1,2,2]
  puts 'YES'
else
  puts 'NO'
end

