var n, m, i, k:longint;
    a:array of array of longint;
    p1, p2:array of longint;

begin
  
  read(n, m);
  setlength(a, m+1, 3);
  setlength(p1, n);
  setlength(p2, n);

  for i:=1 to m do
    read(a[i, 1], a[i, 2]);

  k:=0;
  for i:=1 to m do 
    inc(p1[a[i, 1]]);
  for i:=1 to m do 
    inc(p1[a[i, 2]]);

  for i:=1 to n do 
    if p1[i] div 2 > m-n then
      begin writeln('NO'); exit; end;

end.