#agc055b. [agc055_b]ABC Supremacy

[agc055_b]ABC Supremacy

Problem Statement

You are given a string SS of length NN, consisting of A, B, and C. You are allowed to perform the following operation any number of times:

  • Choose any ii with 1leileN21 \\le i \\le N-2, such that SiSi+1Si+2S_iS_{i+1}S_{i+2} is equal to ABC, BCA, or CAB. Then, replace the three characters with ABC, BCA, or CAB.

For example, you can perform the following transformations with string AABC:

  • AABC to\\to ABCA to\\to BCAA

Determine if you can obtain string TT from string SS with some finite (maybe zero) number of operations above.

Constraints

  • 3leNle5cdot1053\\le N \\le 5\\cdot 10^5
  • SS is a string of length NN consisting of A, B, and C.
  • TT is a string of length NN consisting of A, B, and C.

Input

Input is given from Standard Input in the following format:

NN SS TT

Output

If you can transform SS into TT with the operations above, output YES, otherwise output NO. The checker is case-insensitive: you can use either uppercase or lowercase letters.


Sample Input 1

4
AABC
BCAA

Sample Output 1

YES

This example was explained in the statement.


Sample Input 2

4
ABCA
BCAB

Sample Output 2

NO