Problem6105--ABC216——B - Same Name

6105: ABC216——B - Same Name

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

Description

There are $N\ (2 \leq N \leq 1000)$ people. The family name and given name of the $i$-th person $(1 \leq i \leq N)$ are $S_i$ and $T_i$, respectively.
Determine whether there is a pair of people with the same family and given names. In other words, determine whether there is a pair of integers $(i,\ j)$ such that $1 \leq i \lt j \leq N,\ S_i=S_j,\ \text{and}\ T_i=T_j$.

Input

Input is given from Standard Input in the following format:
$N\\
S_1\ T_1\\
S_2\ T_2\\
\hspace{0.6cm}\vdots\\
S_N\ T_N$

Output

If there is a pair of people with the same family and given names, print Yes; otherwise, print No.

Sample 1 Input

3
tanaka taro
sato hanako
tanaka taro

Sample 1 Output

Yes
The first and third persons have the same family and given names.

Sample 2 Input

3
saito ichiro
saito jiro
saito saburo

Sample 2 Output

No
No two persons have the same family and given names.

Sample 3 Input

4
sypdgidop bkseq
bajsqz hh
ozjekw mcybmtt
qfeysvw dbo

Sample 3 Output

No

EDITORIAL

Source/Category