atcoder#ABC281B. [ABC281B] Sandwich Number
[ABC281B] Sandwich Number
Score : points
Problem Statement
You are given a string consisting of uppercase English letters and digits. Determine whether satisfies the following condition.
- is a concatenation of the following characters and string in the order listed.- An uppercase English letter
- A string of length that is a decimal representation of an integer between and , inclusive
- An uppercase English letter
- An uppercase English letter
- A string of length that is a decimal representation of an integer between and , inclusive
- An uppercase English letter
Constraints
- consists of uppercase English letters and digits.
- The length of is between and , inclusive.
Input
The input is given from Standard Input in the following format:
Output
If satisfies the condition in the problem statement, print Yes
; otherwise, print No
.
Q142857Z
Yes
is a concatenation of Q
, 142857
, and Z
in this order.
Q
and Z
are uppercase English letters, and 142857
is a string of length that is a decimal representation of an integer between and , so satisfies the condition.
AB912278C
No
AB
is not an uppercase English letter, so does not satisfy the condition.
X900000
No
The last character of is not an uppercase English letter, so does not satisfy the condition.
K012345K
No
012345
is not a string of length that is a decimal representation of an integer between and , so does not satisfy the condition.