N = int(raw_input()) S = raw_input() flag = False for i in range(N): for j in range(i,N): if j + (j + 1- i) >= N:break if S[i - 1:j] == S[j + 1 - 1:j + (j + 1 - i)]: flag = True break if flag: break print ('YES' if flag else 'NO')