#include using namespace std; int main(){ long long n; cin >> n; if(n >= 4){ cout << "YES" << endl; return 0; } n++; string str,s = " "; cin >> str; s += str; long long i,j; for(i = 1; i < n; i++){ string str1 = "", str2 = "";; for(j = i; j + (j + 1 - i) <= n; j++){ str1 += s[j]; str2 += s[j+1]; // cout << i << " " << j << endl; // cout << "str1 = " << str1 << " str2 = " << str2 << endl; if(str1 == str2){ cout << "YES" << endl; return 0; } } } cout << "NO" << endl; return 0; }