

Time Limit: 2 sec / Memory Limit: 1024 MiB
配点 : 100 点
問題文
高橋くんは、朝食にご飯、味噌汁、サラダを 1 皿ずつ食べます。
高橋くんの家のテーブルは細長いので、 3 皿を横一列に並べました。並べ方は文字列 S によって与えられ、左から i 番目の皿は S_i が R
ならご飯、 S_i が M
なら味噌汁、 S_i が S
ならサラダです。
ご飯の皿が味噌汁の皿より左にあるかどうかを判定してください。
制約
- |S| = 3
- S には
R
M
S
が 1 文字ずつ含まれる
入力
入力は以下の形式で標準入力から与えられる。
S
出力
ご飯の皿が味噌汁の皿より左にあれば Yes
、そうでなければ No
を出力してください。
入力例 1
RSM
出力例 1
Yes
ご飯の皿は左から 1 番目にあり、味噌汁の皿は左から 3 番目にあります。ご飯の皿の方が左にあるので、 Yes
を出力します。
入力例 2
SMR
出力例 2
No
左から順に、サラダの皿、味噌汁の皿、ご飯の皿と並んでいます。
Score : 100 points
Problem Statement
Takahashi eats three plates for breakfast: rice, miso soup, and salad.
His table is long and narrow, so he arranged the three plates in a row. The arrangement is given by a string S, where the i-th plate from the left is rice if S_i is R
, miso soup if S_i is M
, and salad if S_i is S
.
Determine whether the plate of rice is to the left of the plate of miso soup.
Constraints
- |S| = 3
- S contains one
R
, oneM
, and oneS
.
Input
The input is given from Standard Input in the following format:
S
Output
Print Yes
if the plate of rice is to the left of the plate of miso soup, and No
otherwise.
Sample Input 1
RSM
Sample Output 1
Yes
The plate of rice is at the 1st position from the left, and the plate of miso soup is at the 3rd position from the left. Since the plate of rice is to the left, print Yes
.
Sample Input 2
SMR
Sample Output 2
No
The plates are arranged as salad, miso soup, and rice from left to right.