{"raw_statement":[{"iden":"problem statement","content":"You are given a string $S$ of length $N$, consisting of `A`, `B`, and `C`. You are allowed to perform the following operation any number of times:\n\n*   Choose any $i$ with $1 \\le i \\le N-2$, such that $S_iS_{i+1}S_{i+2}$ is equal to `ABC`, `BCA`, or `CAB`. Then, replace the three characters with `ABC`, `BCA`, or `CAB`.\n\nFor example, you can perform the following transformations with string `AABC`:\n\n*   `AABC` $\\to$ `ABCA` $\\to$ `BCAA`\n\nDetermine if you can obtain string $T$ from string $S$ with some finite (maybe zero) number of operations above."},{"iden":"constraints","content":"*   $3\\le N \\le 5\\cdot 10^5$\n*   $S$ is a string of length $N$ consisting of `A`, `B`, and `C`.\n*   $T$ is a string of length $N$ consisting of `A`, `B`, and `C`."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$\n$S$\n$T$"},{"iden":"sample input 1","content":"4\nAABC\nBCAA"},{"iden":"sample output 1","content":"YES\n\nThis example was explained in the statement."},{"iden":"sample input 2","content":"4\nABCA\nBCAB"},{"iden":"sample output 2","content":"NO"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}