A patrol bot starts at the origin facing North and repeats a fixed instruction cycle forever. Each instruction is one character:
G: move forward one unit in the current facing direction,L: turn 90 degrees to the left (counter-clockwise), staying in place,R: turn 90 degrees to the right (clockwise), staying in place.
The bot is bounded if there exists some circle it never leaves no matter how many times the cycle repeats; otherwise it drifts away forever.
Input format
A single line: a non-empty string of characters, each one of G, L, R (one full instruction cycle).
Output format
Print YES if the bot stays bounded, otherwise print NO.
Constraints
- 1 <= length of the instruction cycle <= 100000