Score : 150150150 points
Problem Statement
The definition of an 11/22 string in this problem is the same as in Problems C and E.
A string TTT is called an 11/22 string when it satisfies all of the following conditions:
- ∣T∣|T|∣T∣ is odd. Here, ∣T∣|T|∣T∣ denotes the length of TTT.
- The 111-st through (∣T∣+12−1)(\frac{|T|+1}{2} - 1)(2∣T∣+1−1)-th characters are all
1
. - The (∣T∣+12)(\frac{|T|+1}{2})(2∣T∣+1)-th character is
/
. - The (∣T∣+12+1)(\frac{|T|+1}{2} + 1)(2∣T∣+1+1)-th through ∣T∣|T|∣T∣-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 SSS of length NNN consisting of 1
, 2
, and /
, determine whether SSS is an 11/22 string.
Constraints
- 1≤N≤1001 \leq N \leq 1001≤N≤100
- SSS is a string of length NNN consisting of
1
,2
, and/
.
Input
The input is given from Standard Input in the following format:
NNN
SSS
Output
If SSS is an 11/22 string, print Yes
; otherwise, print No
.
Sample Input 1Copy
Copy
5
11/22
Sample Output 1Copy
Copy
Yes
11/22
satisfies the conditions for an 11/22 string in the problem statement.
Sample Input 2Copy
Copy
1
/
Sample Output 2Copy
Copy
Yes
/
satisfies the conditions for an 11/22 string.
Sample Input 3Copy
Copy
4
1/22
Sample Output 3Copy
Copy
No
1/22
does not satisfy the conditions for an 11/22 string.
Sample Input 4Copy
Copy
5
22/11
Sample Output 4Copy
Copy
No