In this problem we assume the Earth to be a completely round ball and its surface a perfect sphere. The length of the equator and any meridian is considered to be exactly
40000 kilometers. Thus, travelling from North Pole to South Pole or vice versa takes exactly
20000 kilometers.
Limak, a polar bear, lives on the North Pole. Close to the New Year, he helps somebody with delivering packages all around the world. Instead of coordinates of places to visit, Limak got a desc
ription how he should move, assuming that he starts from the North Pole. The description consists of n parts. In the i-th part of his journey, Limak should move ti kilometers in the direction represented by a string diri that is one of: "North", "South", "West", "East".
Limak isn’t sure whether the description is valid. You must help him to check the following conditions:
- If at any moment of time (before any of the instructions or while performing one of them) Limak is on the North Pole, he can move only to the South.
- If at any moment of time (before any of the instructions or while performing one of them) Limak is on the South Pole, he can move only to the North.
- The journey must end on the North Pole.
Check if the above conditions are satisfied and print "YES" or "NO" on a single line.
Output
Print "
YES" if the desc
ription satisfies the three conditions, otherwise print "NO", both without the quotes.
Note
Drawings below show how Limak's journey would look like in first two samples. In the second sample the answer is "
NO" because he doesn't end on the North Pole.