$input[0]){ $ans= "YES"; $cnt=$input[1]-$input[0]-1; }else{ $cnt=$input[0]+1-$input[1]; } echo $ans."\n"; echo $cnt;