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