Problem2238--Same Name

2238: Same Name

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MB

Description

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)(1iN) 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 N1i<jNS_i=S_jSi=Sj, and T_i=T_jTi=Tj.

Constraints

  • 2 \leq N \leq 10002N1000
  • 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}\vdotsS_NSNT_NTN

Output

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

Sample Input Copy

3
tanaka taro
sato hanako
tanaka taro

Sample Output Copy

Yes

Source/Category