#define _USE_MATH_DEFINES #include #include #include #include #include #include #include #include #include #include #include #include #include ///////// #define REP(i, x, n) for(int i = x; i < n; i++) #define rep(i,n) REP(i,0,n) #define P(p) cout<<(p)< ///////// typedef long long LL; typedef long double LD; ///////// using namespace::std; ///////// void solve(){ int N; string str; cin >> N; if( N >= 4 ){ cout << "YES\n"; } cin >> str; int h,i,k; bool flag; for(h = 0; h < N/2; ++h){ for(i=0; i+2*h+1 < N; ++i ){ flag = true; for(k=0;k <= h; ++k){ if( str[i+k] != str[i+h+1+k] ){ i = i + k; flag = false; break; } } if( flag ){ cout << "YES\n"; return; } } } cout << "NO\n"; return; } int main(void){ std::cin.tie(0); std::ios::sync_with_stdio(false); std::cout << std::fixed;// //cout << setprecision(16);// //cpp solve(); return 0; }