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