($n,$m)=glob<>; @s=map[glob],<>; for(@s){ ++$d[$a=$_->[0]]; ++$d[$b=$_->[1]]; vec($e[$a],$b,1)=1; vec($e[$b],$a,1)=1; vec($h,$a,1)=1; vec($h,$b,1)=1; } for(0..$n-1){ $c+=$d[$_]%2; } if($c>2){ print"NO"; exit; } sub f{ my($a)=@_; if(!vec($g,$a,1)){ vec($g,$a,1)=1; for(0..$n){ if(vec($e[$a],$_,1)){ f($_); } } } } f(0); if($g!=$h){ print"NO"; exit; } print"YES";