#include using namespace std; int main() { int n; string str; cin>>n>>str; if(n == 1){ cout<<"NO"; return 0; } bool flg = false; //substringをもとめなくても、隣が同じ時点でOKなので、それを確かめる int strSize = str.size(); for(int i=0 ; i< strSize-1; i++) { if(str[i] == str[i+1] ){ flg = true; } } if(flg){ cout<<"YES"; }else{ cout<<"NO"; } return 0; }