n = gets.to_i s = gets.chomp (n-1).times{|j| 0.upto(j){|i| if s[i..j] == s[(j+1)..(2*j-i+1)] puts "YES" exit end } } puts "NO"