N, M = gets.split.map &:to_i h = Hash.new 0 gets(p).split.each{|s| h[s] ^= 1 } puts h.values.sum > 2 ? :NO : :YES