{"problem":{"name":"ABC Supremacy","description":{"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: *   Choose any $i$ with $1 \\le i \\le N-2$, such that","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"agc055_b"},"statements":[{"statement_type":"Markdown","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.\n\n## Constraints\n\n*   $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`.\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$N$\n$S$\n$T$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"agc055_b","tags":[],"sample_group":[["4\nAABC\nBCAA","YES\n\nThis example was explained in the statement."],["4\nABCA\nBCAB","NO"]],"created_at":"2026-03-03 11:01:14"}}