Bob is admiring a beautiful postmodern exhibit at the local art gallery. The exhibit consists of colourful neon lamps in a line, labelled to , and each lamp can be one of two colours: a vibrant fuchsia or a soothing aquamarine.
The exhibit also happens to be interactive. There are buttons that the visitors can press, labelled to . Pressing button will simultaneously change the colours of lamps and (from fuchsia to aquamarine or aquamarine to fuchsia), but only if those lamps are the same colour. Obviously, this represents the profound fragility and changeable nature of the human condition.
Bob notices that the colours of the lamps currently form pattern . He thinks they would look good in pattern , so he wants to know if it is possible to get to from by a sequence of zero or more button presses.
Subtask 1 [20%]
Subtask 2 [20%]
Subtask 2 [60%]
The first line will contain one integer, .
The second line will contain a string of characters, either
F (fuchsia) or
A (aquamarine), pattern .
The third and final line will contain a string of characters, either
A, pattern .
YES if it is possible to get to from and
Sample Input 1
6 FAAFFF FFAAFF
Sample Output 1
Sample Input 2
6 FAFAFA AFAFAF
Sample Output 2