a = [0, 0, 0]
b = [0, 0, 0]

3.times do |i|
  (p, q) = gets.chomp.split(' ').map(&:to_i)
  a[i] = p - 1
  b[i] = q - 1
end

c = [0, 0, 0, 0]
3.times do |i|
  c[ a[i] ] += 1
  c[ b[i] ] += 1
end

f = true
4.times do |i|
  if c[i] == 3 then
    f = false
    break
  end
end
  
puts (f ? 'YES' : 'NO')