#abc291c. [abc291_c]LRUD Instructions 2
[abc291_c]LRUD Instructions 2
Problem Statement
Takahashi is on a two-dimensional plane. Starting from the origin, he made moves.
The moves are represented by a string of length as described below:
-
Takahashi's coordinates after the -th move are:
- if the -th character of is
R
; - if the -th character of is
L
; - if the -th character of is
U
; and - if the -th character of is
D
,
where is his coordinates before the move.
- if the -th character of is
Determine if Takahashi visited the same coordinates multiple times in the course of the moves (including the starting and ending points).
Constraints
- is an integer.
- is a string of length consisting of
R
,L
,U
, andD
.
Input
The input is given from Standard Input in the following format:
Output
Print Yes
if Takahashi visited the same coordinates multiple times in the course of the moves; print No
otherwise.
Sample Input 1
Sample Output 1
Takahashi's coordinates change as follows: .