gets;s=gets;n=s.size puts n.times.any?{|i|(i..(n+i)/2).any?{|j|s[i..j]==s[j+=1,j-i]}}?:YES:'NO'