#abc364a. A - Glutton Takahashi

A - Glutton Takahashi

Score : 100100 points

问题陈述

高桥计划吃 NN 道菜。

他计划吃的第 ii 道菜如果是甜的,那么 Si=S_i = 甜的;如果是咸的,那么 Si=S_i = 咸的

如果他连续吃两道甜菜,他会感觉恶心,无法再吃任何菜。

确定他是否能吃完所有菜。

以上为大语言模型 kimi 翻译,仅供参考。

Problem Statement

Takahashi is planning to eat NN dishes.

The ii-th dish he plans to eat is sweet if Si=S_i = sweet, and salty if Si=S_i = salty.

If he eats two sweet dishes consecutively, he will feel sick and be unable to eat any more dishes.

Determine whether he can eat all the dishes.

Constraints

  • NN is an integer between 11 and 100100, inclusive.
  • Each SiS_i is sweet or salty.

Input

The input is given from Standard Input in the following format:

NN

S1S_1

S2S_2

\vdots

SNS_N

Output

Print Yes if Takahashi can eat all the dishes, and No otherwise.

Sample Input 1

5
salty
sweet
salty
salty
sweet

Sample Output 1

Yes

He will not eat two sweet dishes consecutively, so he can eat all the dishes without feeling sick.

Sample Input 2

4
sweet
salty
sweet
sweet

Sample Output 2

Yes

He will feel sick but can still eat all the dishes.

Sample Input 3

6
salty
sweet
sweet
salty
sweet
sweet

Sample Output 3

No

He feels sick when eating the 3rd dish and cannot eat the 4th and subsequent dishes.