path_list = 3.times.map { gets.split(' ').map(&:to_i) }
edge_to_count = Hash.new(0)
path_list.each do |(a, b)|
  edge_to_count[a] += 1
  edge_to_count[b] += 1
end

ans = edge_to_count.keys.size == 4 && edge_to_count.values.max < 3
puts(ans ? 'YES': 'NO')
