#include int main(void) { int n; char s[1000001]; scanf("%d", &n); scanf("%s", &s); if(n == 1){ printf("NO\n"); } else if(n == 2){ if(s[0] == s[1]){ printf("YES\n"); } else{ printf("NO\n"); } } else if(n == 3){ if(s[0] == s[2] && s[0] != s[1]){ printf("NO\n"); } else{ printf("YES\n"); } } else{ printf("YES\n"); } return 0; }