Time Limit: 2 sec / Memory Limit: 1024 MB
Score : 200200 points
Problem Statement
There are NN people. The family name and given name of the ii-th person (1 \leq i \leq N)(1≤i≤N) are S_iSi and T_iTi, 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)(i,j) such that 1 \leq i \lt j \leq N1≤i<j≤N, S_i=S_jSi=Sj, and T_i=T_jTi=Tj.
Constraints
-
2 \leq N \leq 10002≤N≤1000
-
NN is an integer.
-
Each of S_iSi and T_iTi is a string of length between 11 and 1010 (inclusive) consisting of English lowercase letters.
Input
Input is given from Standard Input in the following format:
NNS_1S1T_1T1S_2S2T_2T2\hspace{0.6cm}\vdots⋮S_NSNT_NTN
Output
If there is a pair of people with the same family and given names, print Yes; otherwise, print No.