until (n, m = gets.split.map(&:to_i)).all?(&:zero?)
  degree = Array.new(n, 0)
  m.times do
    u, v = gets.split.map{|i| i.to_i - 1}
    degree[u] += 1
    degree[v] += 1
  end
  puts degree.all?{|i| i <= 2} ? "yes" : "no"
end