import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class N290 { public static void main(String[] args) throws IOException { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); int l=Integer.parseInt(br.readLine()); String str=br.readLine(); int end=0; for(int i=1;end==0&&i<=l;i++) { for(int j=i;end==0&&j+1<=l&&j+(j+1-i)<=l;j++) { if(str.substring(i-1, j-1).equals(str.substring(j,j+(j-i)))) {end++;} } } if(end==1){System.out.println("YES");} else{System.err.println("NO");} } }