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