#coding=UTF-8 #別解 既存のものを使う import re#既存のもの N=int(input()) S=input() if re.search('(.+?)\\1',S):#逆greedy 実は解説の通りで間に合う print('YES') else: print('NO')