

Time Limit: 2 sec / Memory Limit: 1024 MB
配点 : 点
問題文
この問題における 11/22 文字列の定義は C 問題および E 問題と同じです。
文字列 が以下の条件を全て満たすとき、 を 11/22 文字列 と呼びます。
- は奇数である。ここで、 は の長さを表す。
- 文字目から 文字目までが
1
である。 - 文字目が
/
である。 - 文字目から 文字目までが
2
である。
例えば 11/22
, 111/222
, /
は 11/22 文字列ですが、1122
, 1/22
, 11/2222
, 22/11
, //2/2/211
はそうではありません。
1
, 2
, /
からなる長さ の文字列 が与えられます。 が 11/22 文字列であるか判定してください。
制約
- は
1
,2
,/
からなる長さ の文字列
入力
入力は以下の形式で標準入力から与えられる。
出力
が 11/22 文字列であれば Yes
を、そうでなければ No
を出力せよ。
入力例 1Copy
5 11/22
出力例 1Copy
Yes
11/22
は問題文の 11/22 文字列の条件を満たします。
入力例 2Copy
1 /
出力例 2Copy
Yes
/
は問題文の 11/22 文字列の条件を満たします。
入力例 3Copy
4 1/22
出力例 3Copy
No
1/22
は問題文の 11/22 文字列の条件を満たしません。
入力例 4Copy
5 22/11
出力例 4Copy
No
Score : points
Problem Statement
The definition of an 11/22 string in this problem is the same as in Problems C and E.
A string is called an 11/22 string when it satisfies all of the following conditions:
- is odd. Here, denotes the length of .
- The -st through -th characters are all
1
. - The -th character is
/
. - The -th through -th characters are all
2
.
For example, 11/22
, 111/222
, and /
are 11/22 strings, but 1122
, 1/22
, 11/2222
, 22/11
, and //2/2/211
are not.
Given a string of length consisting of 1
, 2
, and /
, determine whether is an 11/22 string.
Constraints
- is a string of length consisting of
1
,2
, and/
.
Input
The input is given from Standard Input in the following format:
Output
If is an 11/22 string, print Yes
; otherwise, print No
.
Sample Input 1Copy
5 11/22
Sample Output 1Copy
Yes
11/22
satisfies the conditions for an 11/22 string in the problem statement.
Sample Input 2Copy
1 /
Sample Output 2Copy
Yes
/
satisfies the conditions for an 11/22 string.
Sample Input 3Copy
4 1/22
Sample Output 3Copy
No
1/22
does not satisfy the conditions for an 11/22 string.
Sample Input 4Copy
5 22/11
Sample Output 4Copy
No