atcoder#ABC296A. [ABC296A] Alternately

[ABC296A] Alternately

Score : 100100 points

Problem Statement

There is a row of NN people. They are described by a string SS of length NN. The ii-th person from the front is male if the ii-th character of SS is M, and female if it is F.

Determine whether the men and women are alternating.

It is said that the men and women are alternating if and only if there is no position where two men or two women are adjacent.

Constraints

  • 1N1001 \leq N \leq 100
  • NN is an integer.
  • SS is a string of length NN consisting of M and F.

Input

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

NN

SS

Output

Print Yes if the men and women are alternating, and No otherwise.

6
MFMFMF
Yes

There is no position where two men or two women are adjacent, so the men and women are alternating.

9
FMFMMFMFM
No
1
F
Yes