l=[]
while gets
  n,m=$_.split.map(&:to_i)
  if n==0 and m==0
    tf=true
    (3..(l.max)).each do |x|
      tf=l.count(x).even?
      break unless tf
    end
    puts tf ? "YES" : "NO"
    l=[]
  else
    l<<n<<m
  end
end