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