Problem9308--ABC296 —— A - Alternately

9308: ABC296 —— A - Alternately

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 512 MiB

Description

There is a row of $N$ people. They are described by a string $S$ of length $N$. The $i$-th person from the front is male if the $i$-th character of $S$ 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.

Input

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

```
$N$
$S$
```

Output

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

Constraints

-   $1 \leq N \leq 100$
-   $N$ is an integer.
-   $S$ is a string of length $N$ consisting of `M` and `F`.

Sample 1 Input

6
MFMFMF

Sample 1 Output

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

Sample 2 Input

9
FMFMMFMFM

Sample 2 Output

No

Sample 3 Input

1
F

Sample 3 Output

Yes

Source/Category