atcoder#ABC277B. [ABC277B] Playing Cards Validation
[ABC277B] Playing Cards Validation
Score : points
Problem Statement
You are given strings, each of length , consisting of uppercase English letters and digits. The -th string is .
Determine whether the following three conditions are all satisfied.
・For every string, the first character is one of H
, D
, C
, and S
.
・For every string, the second character is one of A
, 2
, 3
, 4
, 5
, 6
, 7
, 8
, 9
, T
, J
, Q
, K
.
・All strings are pairwise different. That is, if , then .
Constraints
- is a string of length consisting of uppercase English letters and digits.
Input
The input is given from Standard Input in the following format:
Output
If the three conditions are all satisfied, print Yes
; otherwise, print No
.
4
H3
DA
D3
SK
Yes
One can verify that the three conditions are all satisfied.
5
H3
DA
CK
H3
S7
No
Both and are H3
, violating the third condition.
4
3H
AD
3D
KS
No
5
00
AA
XX
YY
ZZ
No