path = Array.new(3).map{Array.new(2, 0)}
path[0] = gets.split.map(&:to_i)
path[1] = gets.split.map(&:to_i)
path[2] = gets.split.map(&:to_i)
ans = Array.new(4, 0)
for i in 0..2
  for j in 0..1
    if path[i][j] == 1
      ans[0] += 1
    elsif path[i][j] == 2
      ans[1] += 1
    elsif path[i][j] == 3
      ans[2] += 1
    else
      ans[3] +- 1
    end
  end
end
ans.sort!
if ans[1] == 1 && ans[2] == 2
  puts "YES"
else
  puts "NO"
end
