import java.util.Scanner; public class Test { public static Scanner sc = new Scanner(System.in); public static void main(String[] args) { int n = sc.nextInt(); String s = sc.next(); for(int i = 0; i < n-1; i++){ for(int j = i+1; j < n && 2*j-i <= n; j++){ if(s.substring(i, j).equals(s.substring(j, 2*j-i))){ System.out.println("YES"); return; } } } System.out.println("NO"); } }