#!/usr/bin/env python N = int(input()) slist = [int(x) for x in list(input().strip())] for i in range(N+1): if (N+i-2)/2 < i: break for j in range(i, (N+i-2)//2+1): if slist[i:j+1] == slist[j+1:2*j-i+2]: print('YES') quit() print('NO')