@D=(<>!~$",glob<>); for$i(1..$#D){ while($i=$D[$j=$i]){ $D[$j]=0; $c+=!!$D[$i]; } } print$'>=$c&&($'-$c)%2==0?YES:NO,$/