Question
Following Directions

There is a candy at (1,1) (that is, one unit above and one unit to the right of Alperen's starting point). You need to determine if Alperen ever passes the candy.

Alperen is standing at the point (0,0). He is given a string ๐ of length ๐ and performs ๐ moves. The ๐-th move is as follows:
- if ๐ ๐=๐ป, then move one unit left;
- if ๐ ๐=๐, then move one unit right;
- if ๐ ๐=๐, then move one unit up;
- if ๐ ๐=๐ณ, then move one unit down.

There is a candy at (1,1) (that is, one unit above and one unit to the right of Alperen's starting point). You need to determine if Alperen ever passes the candy.

Input
The first line of each test case contains an integer ๐ (1โค๐โค50) โ the length of the string.
The second line of each test case contains a string ๐ of length ๐ consisting of characters ๐ป, ๐, ๐ณ, and ๐, denoting the moves Alperen makes.
The second line of each test case contains a string ๐ of length ๐ consisting of characters ๐ป, ๐, ๐ณ, and ๐, denoting the moves Alperen makes.
Output
For each test case, output "YES" (without quotes) if Alperen passes the candy, and "NO" (without quotes) otherwise.
Example
Example 1:
Input
7
UUURDDL
Output
YES
Explanation:
Alperen follows the path
(0,0)โ๐(0,1)โ๐(0,2)โ๐(0,3)โ๐(1,3)โ๐ณ(1,2)โ๐ณ(1,1)โ๐ป(0,1).
Note that Alperen doesn't need to end at the candy's location of (1,1), he just needs to pass it at some point.
Example 2:
Input
2
UR
Output
YES
Explanation:
(0,0)โ๐(0,1)โ๐(1,1).
Input
7
UUURDDL
Output
YES
Explanation:
Alperen follows the path
(0,0)โ๐(0,1)โ๐(0,2)โ๐(0,3)โ๐(1,3)โ๐ณ(1,2)โ๐ณ(1,1)โ๐ป(0,1).
Note that Alperen doesn't need to end at the candy's location of (1,1), he just needs to pass it at some point.
Example 2:
Input
2
UR
Output
YES
Explanation:
(0,0)โ๐(0,1)โ๐(1,1).