In africa jungle , there were zebra's who liked to spit.
There owner watched them for whole day and noted in his sheet where each zebra spitted.
Now he's in a confusion and wants to know if in the jungle there are two zebra's which spitted at each other.
Help him solve this task.
If the zebra is present in position a spits b metres right , he can hit only zebra in position a+b , if such a zebra exists.
-----Input:-----
- The first line contains integer t(1<=t<100)- amount of zebras in jungle.
- Each of following t lines contains two integers a(i) and b(i)(-10^4<=x(i)<=10^4,1<|d(i)|<=2.10^4) - records in owner sheet.
- a(i) is the position of i-th zebra and b(i) is distance at which the i-th camel spitted.
Positive values of d(i) correspond to spits right, negative values correspond to spit left.No two zebras may stand in the same position.
-----Output:-----
If there are two zebras , which spitted at each other , output YES, otherwise , output NO.
-----Sample Input:-----
2
0 1
1 -1
-----Sample Output:-----
YES
# cook your dish here
n=int(input())
a=[]
for i in range(n):
    x,y=map(int,input().split())
    a.append([x,x+y])
ans=False    
for i in range(n):
    for j in range(n):
        if(i==j): continue
        if(a[i][1]==a[j][0] and a[i][0]==a[j][1]):
            ans=True;break
if(ans):print("YES")
else:print("NO")
# cook your dish here
n=int(input())
a=[]
for i in range(n):
    x,y=map(int,input().split())
    a.append([x,x+y])
ans=False    
for i in range(n):
    for j in range(n):
        if(i==j): continue
        if(a[i][1]==a[j][0] and a[i][0]==a[j][1]):
            ans=True;break
if(ans):print("YES")
else:print("NO")