LearnPy Hub
← Arena
AdvancedRating 1500

Robot in a Circle

A robot starts at (0, 0) facing north and repeats the instructions G (go 1), L (turn left), R (turn right) forever. Print YES if it stays within some circle.

Input

One line.

Output

YES or NO.

Sample 1

Input
GGLLGG
Output
YES

Sample 2

Input
GG
Output
NO
solution.py
Output appears here
Robot in a Circle · Python Arena problem · LearnPy Hub