Problem7421--ABC277 —— B - Playing Cards Validation

7421: ABC277 —— B - Playing Cards Validation

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 256 MiB

Description

You are given N strings, each of length 2, consisting of uppercase English letters and digits. The i-th string is $S_i$.
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 $i \neq j$, then $S_i \neq S_j$.

Input

The input is given from Standard Input in the following format:
$N$
$S_1$
$S_2$
$\vdots$
$S_N$

Output

If the three conditions are all satisfied, print Yes; otherwise, print No.

Constraints

1≤N≤52
$S_i$ is a string of length 2 consisting of uppercase English letters and digits.

Sample 1 Input

4
H3
DA
D3
SK

Sample 1 Output

Yes
One can verify that the three conditions are all satisfied.

Sample 2 Input

5
H3
DA
CK
H3
S7

Sample 2 Output

No
Both $S_1$ and $S_4$ are H3, violating the third condition.

Sample 3 Input

4
3H
AD
3D
KS

Sample 3 Output

No

5
00
AA
XX
YY
ZZ

No

Source/Category