{"raw_statement":[{"iden":"problem statement","content":"You are given a string $S$ of length $N$ consisting of `A` and `B`.\nYou can repeat the following operation zero or more times:\n\n*   choose a pair of adjacent characters in $S$ and replace them with `AB`.\n\nDetermine whether $S$ can be turned into a palindrome.\nWhat is a palindrome? A string $T$ is a palindrome if and only if, for every integer $i$ ($1 \\le i \\le |T|$), the $i$\\-th character from the beginning and the $i$\\-th character from the end are the same, where $|T|$ is the length of $T$."},{"iden":"constraints","content":"*   $2 \\leq N \\leq 2\\times 10^5$\n*   $S$ is a string of length $N$ consisting of `A` and `B`."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$\n$S$"},{"iden":"sample input 1","content":"3\nBBA"},{"iden":"sample output 1","content":"Yes\n\nReplacing the $2$\\-nd and $3$\\-rd characters, `BA`, with `AB` will turn $S$ into `BAB`, a palindrome."},{"iden":"sample input 2","content":"4\nABAB"},{"iden":"sample output 2","content":"No\n\nNo sequence of operations can turn $S$ into a palindrome."}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}