import java.util.Scanner; public class Main { @SuppressWarnings("resource") public static void main(String args[]) { Scanner scanner = new Scanner(System.in); int n=scanner.nextInt(); String s=scanner.next(); for(int i=1;i<=n;i++) { for(int j=i;j+(j+1-i)<=n;j++) { String a=s.substring(i-1,j); String b=s.substring(j,j+(j+1-i)); if(a.equals(b)) { System.out.println("YES"); return; } } } System.out.println("NO"); } }