#include #include #include #include #include #include #include #include #include #include #include using ll = long long; using namespace std; int main() { ll n; string s; cin >> n >> s; for (int i = 0; i < n - 1; i++){ for (int j = i; 2*j < n+i-1; j++){ bool yes = true; for (int k = 0; k < j - i + 1; k++){ if (s[i+k] != s[j+1+k]) { yes = false; break; } } if (yes) { cout << "YES" << endl; return 0; } } } cout << "NO" << endl; }