d = Array.new(4).map{Array.new(4, 0)}

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

4.times do |i|
  4.times do |j|
    4.times do |k|
      if d[i][j] == 1
        if d[j][k] && i != k && j != k
          if d[k][[0, 1, 2, 3].select{|z| z!= i && z != j && z != k}.at(0)] == 1
            puts 'YES'
            exit
          end
        end
      end
    end
  end
end

puts 'NO'