n=gets.to_i s = gets.chomp yesno = n.times.find do |i| i.upto(n-1).find do |j| s[i .. j] == s[j .. 2*j-i+1] end end puts yesno ? "YES" : "NO"