#include <bits/stdc++.h>

#define int long long
#define pb push_back
#define F first
#define S second
#define pii pair <int,int>

using namespace std;

const int N=509,INF=1e9;
vector <int> adj[N],v1,v2;
int dis[N][N][2],par[N][N][2];
bool mrk[N][N][2];

inline void BFS(int n){
    for(int i=0;i<N;i++) for(int j=0;j<N;j++) dis[i][j][0]=dis[i][j][1]=INF;
    queue <pair <pii,bool> > q;
    mrk[1][n][0]=1; dis[1][n][0]=0;
    q.push({{1,n},0});
    while(!q.empty()){
        int x=q.front().F.F,y=q.front().F.S,t=q.front().S;
        q.pop();
        if(!t){
            for(auto v:adj[x]){
                if(!mrk[v][y][1]){
                    par[v][y][1]=x;
                    dis[v][y][1]=dis[x][y][0]+1;
                    mrk[v][y][1]=1;
                    q.push({{v,y},1});
                }
            }
        }
        else for(auto v:adj[y]) if(!mrk[x][v][0] && v!=x){
            par[x][v][0]=y;
            dis[x][v][0]=dis[x][y][1]+1;
            mrk[x][v][0]=1;
            q.push({{x,v},0});
        }
    }
}

int32_t main(){
    ios::sync_with_stdio(0);cin.tie(0);
    int n,m;
    cin>>n>>m;
    for(int i=0;i<m;i++){
        int u,v;
        cin>>u>>v;
        adj[u].pb(v); adj[v].pb(u);
    }
    BFS(n);
    if(!mrk[n][1][0]) return cout<<-1,0;
    cout<<dis[n][1][0]/2<<endl;
    int x=n,y=1;
    while(x!=0){
        v2.pb(x),v1.pb(y);
        y=par[x][y][0];
        x=par[x][y][1];
    }
    for(auto i:v1) cout<<i<<" ";
    cout<<endl;
    for(auto i:v2) cout<<i<<" ";
    return 0;
}


#include <bits/stdc++.h>

#define int long long
#define pb push_back
#define F first
#define S second
#define pii pair <int,int>

using namespace std;

const int N=509,INF=1e9;
vector <int> adj[N];
int dis[N][N][2],par[N][N][2];
bool mrk[N][N][2];

inline void BFS(int n){
    for(int i=0;i<N;i++) for(int j=0;j<N;j++) dis[i][j][0]=dis[i][j][1]=INF;
    queue <pair <pii,bool> > q;
    mrk[1][n][0]=1; dis[1][n][0]=0;
    q.push({{1,n},0});
    while(!q.empty()){
        int x=q.front().F.F,y=q.front().F.S,t=q.front().S;
        q.pop();
        if(!t){
            for(auto v:adj[x]){
                if(!mrk[v][y][1]){
                    par[v][y][1]=x;
                    dis[v][y][1]=dis[x][y][0]+1;
                    mrk[v][y][1]=1;
                    q.push({{v,y},1});
                }
            }
        }
        else{
            for(auto v:adj[y]){
                if(!mrk[x][v][0] && v!=x){
                    par[x][v][0]=y;
                    dis[x][v][0]=dis[x][y][1]+1;
                    mrk[x][v][0]=1;
                    q.push({{x,v},0});
                }
            }
        }
    }
}

int32_t main(){
    ios::sync_with_stdio(0);cin.tie(0);
    int n,m;
    cin>>n>>m;
    for(int i=0;i<m;i++){
        int u,v;
        cin>>u>>v;
        adj[u].pb(v); adj[v].pb(u);
    }
    BFS(n);
    if(!mrk[n][1][0]) return cout<<-1,0;
    cout<<dis[n][1][0]<<endl;
    vector <int> v1,v2;
    int x=n,y=1;
    while(x!=0){
        v2.pb(x),v1.pb(y);
        y=par[x][y][0];
        x=par[x][y][1];
    }
    for(auto i:v1) cout<<i<<" ";
    cout<<endl;
    for(auto i:v2) cout<<i<<" ";
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int MAXN = 600;
struct state{
	int f, s, tu;
}p[MAXN][MAXN][2];
queue<state> q;
vector<int> a[MAXN];
int dis[MAXN][MAXN][2], n;

void print1(int x, int y, int t){
	int nx = p[x][y][t].f, ny = p[x][y][t].s;
	if(!(nx == 0 && ny == n - 1))
		print1(nx, ny, !t);
	if(t == 0)cout << x + 1 << ' ';
}

void print2(int x, int y, int t){
	int nx = p[x][y][t].f, ny = p[x][y][t].s;
	if(!(nx == 0 && ny == n - 1))
		print2(nx, ny, !t);
	if(t)cout << y + 1 << ' ';
}

int main(){
	int m;
	cin >> n >> m;
	for(int i = 0, x, y; i < m; i++){
		cin >> x >> y;
		x--;y--;
		a[x].push_back(y);
		a[y].push_back(x);
	}
	dis[0][n - 1][0] = 1;
	q.push(state{0, n - 1, 0});

	while(q.size()){
		int x = q.front().f, y = q.front().s, t = q.front().tu;
		q.pop();
		if(t == 0)
			for(auto xx: a[x]){
				if(!dis[xx][y][!t]){
						dis[xx][y][!t] = dis[x][y][t] + 1;
						p[xx][y][!t] = state{x, y, t};
						q.push(state{xx, y, !t});
				}
			}
		else
			for(auto yy: a[y]){
				if(!dis[x][yy][!t]){
					if(x != yy){
						dis[x][yy][!t] = dis[x][y][t] + 1;
						p[x][yy][!t] = state{x, y, t};
						q.push(state{x, yy, !t});
					}
				}
			}
	}
	int ans = dis[n - 1][0][0];
	vector<int> ans1, ans2;
	if(!ans){
		cout << -1;
		return 0;
	}
	cout << (ans - 1) / 2 << endl;
	int x = n - 1, y = 0, t = 0;
	for(int i = 0; i < ans; i++){
		if(t == 0){
			ans1.push_back(x);
		}
		int l = x;
		x = p[x][y][t].f;
		y = p[l][y][t].s;
		t = !t;
	}
	x = n - 1;y = 0; t = 0;
	ans2.push_back(0);
	for(int i = 0; i < ans; i++){
		if(t == 1){
			ans2.push_back(y);
		}
		int l = x;
		x = p[x][y][t].f;
		y = p[l][y][t].s;
		t = !t;
	}
	while(!ans1.empty()){
		cout << ans1.back() + 1 << ' ';
		ans1.pop_back();
	}
	cout << endl;
	while(!ans2.empty()){
		cout << ans2.back() + 1 << ' ';
		ans2.pop_back();
	}
	return 0;
}


#include <cstdio>
#include <queue>

struct V {
    int a, b;
    int wybor;
};

std::vector<int> v[507];
V prev[507][507][2];
int odl[507][507][2];
bool odw[507][507][2];
std::queue<V> Q;
int wynik[1000007][2];

int main() {
    int N, M;
    scanf("%d%d", &N, &M);
    int a, b;
    for (int i = 0; i < M; i++) {
        scanf("%d%d", &a, &b);
        v[a].push_back(b);
        v[b].push_back(a);
    }
    Q.push({1, N, 0});
    odw[1][N][0] = true;
    while (!Q.empty()) {
        V ter = Q.front();
        Q.pop();
        if (ter.a == N && ter.b == 1 && ter.wybor == 0)
            break;
        if (ter.a == ter.b && ter.wybor == 0)
            continue;
        a = ter.a, b = ter.b;
        if (ter.wybor == 0) {
            for (auto it : v[a]) {
                if (!odw[it][b][1]) {
                    odw[it][b][1] = true;
                    odl[it][b][1] = odl[ter.a][ter.b][ter.wybor] + 1;
                    prev[it][b][1] = ter;
                    Q.push({it, b, 1});
                }
            }
        } else {
            for (auto it : v[b]) {
                if (!odw[a][it][0]) {
                    odw[a][it][0] = true;
                    odl[a][it][0] = odl[ter.a][ter.b][ter.wybor] + 1;
                    prev[a][it][0] = ter;
                    Q.push({a, it, 0});
                }
            }
        }
    }
    if (odl[N][1][0] == 0) {
        printf("-1");
        return 0;
    }
    int wyn = odl[N][1][0] / 2;
    auto ter = V{N, 1, 0};
    wynik[wyn][1] = 1;
    while (ter.a != 0) {
        wynik[odl[ter.a][ter.b][ter.wybor] / 2][ter.wybor] = ter.wybor ? ter.b : ter.a;
        ter = prev[ter.a][ter.b][ter.wybor];
    }
    for (int i = 0; i <= wyn; i++)
        printf("%d ", wynik[i][0]);
    printf("\n");
    for (int i = 0; i <= wyn; i++)
        printf("%d ", wynik[i][1]);
    printf("\n");
    return 0;
}


#include <cstdio>
#include <queue>

struct V {
    int a, b;
    int wybor;
};

std::vector<int> v[507];
V prev[507][507][2];
int odl[507][507][2];
bool odw[507][507][2];
std::queue<V> Q;
int wynik[1000007][2];

int main() {
    int N, M;
    scanf("%d%d", &N, &M);
    int a, b;
    for (int i = 0; i < M; i++) {
        scanf("%d%d", &a, &b);
        v[a].push_back(b);
        v[b].push_back(a);
    }
    Q.push({1, N, 0});
    odw[1][N][0] = true;
    while (!Q.empty()) {
        V ter = Q.front();
        Q.pop();
        if (ter.a == N && ter.b == 1 && ter.wybor == 0)
            break;
        if (ter.a == ter.b && ter.wybor == 0)
            continue;
        a = ter.a, b = ter.b;
        if (ter.wybor == 0) {
            for (auto it : v[a]) {
                if (!odw[it][b][1]) {
                    odw[it][b][1] = true;
                    odl[it][b][1] = odl[ter.a][ter.b][ter.wybor] + 1;
                    prev[it][b][1] = ter;
                    Q.push({it, b, 1});
                }
            }
        } else {
            for (auto it : v[b]) {
                if (!odw[a][it][0]) {
                    odw[a][it][0] = true;
                    odl[a][it][0] = odl[ter.a][ter.b][ter.wybor] + 1;
                    prev[a][it][0] = ter;
                    Q.push({a, it, 0});
                }
            }
        }
    }
    if (odl[N][1][0] == 0) {
        printf("-1");
        return 0;
    }
    int wyn = odl[N][1][0] / 2;
    auto ter = V{N, 1, 0};
    wynik[wyn][1] = 1;
    while (ter.a != 0) {
        wynik[odl[ter.a][ter.b][ter.wybor] / 2][ter.wybor] = ter.wybor ? ter.b : ter.a;
        ter = prev[ter.a][ter.b][ter.wybor];
    }
    printf("%d\n", wyn);
    for (int i = 0; i <= wyn; i++)
        printf("%d ", wynik[i][0]);
    printf("\n");
    for (int i = 0; i <= wyn; i++)
        printf("%d ", wynik[i][1]);
    printf("\n");
    return 0;
}


#include<stdio.h>
#include<iostream>
#include<utility>
#include<queue>

using namespace std;

#define MAXN 505

int dist[MAXN][MAXN];
vector<int> e[MAXN],
            path1,
            path2;
pair<int, int>  p[MAXN][MAXN];

int main() {
    int n = 0,
        m = 0,
        x = 0,
        y = 0;
    ios::sync_with_stdio(false);
    cin.tie(0);

    cin>>n>>m;
    for(int i = 0; i<m; ++i) {
        cin>>x>>y;
        e[x].push_back(y);
        e[y].push_back(x);
    }

    queue<int>  q;
    q.push(1);
    q.push(n);

    dist[1][n] = 1;
    p[1][n] = {0,0};

    while(!q.empty()) {
        int u = q.front();
        q.pop();
        int v = q.front();
        q.pop();

        if(u == v) {
            continue;
        }

        for(auto nu : e[u]) {
            for(auto nv : e[v]) {
                if(!dist[nu][nv]) {
                    dist[nu][nv] = dist[u][v]+1;
                    q.push(nu);
                    q.push(nv);
                    p[nu][nv] = {u,v};
                }
            }
        }
    }

    if(!dist[n][1]) {
        printf("-1\n");
        return 0;
    }

    int u = n,
        v = 1;

    while(u+v>1) {
        path1.push_back(u);
        path2.push_back(v);
        int nu = p[u][v].first,
            nv = p[u][v].second;
        u = nu;
        v = nv;
    }

    int res = path1.size()-1;
    printf("%d\n", res);
    for(int i = 0; i<path2.size(); ++i) {
        printf("%d ", path2[i]);
    }
    printf("\n");
    for(int i = 0; i<path1.size(); ++i) {
        printf("%d ", path1[i]);
    }
    printf("\n");

    return 0;
}


#include<stdio.h>
#include<iostream>
#include<utility>
#include<queue>

using namespace std;

#define MAXN 505

int dist[MAXN][MAXN];
vector<int> e[MAXN],
            path1,
            path2;
pair<int, int>  p[MAXN][MAXN];

int main() {
    int n = 0,
        m = 0,
        x = 0,
        y = 0;

    scanf("%d%d", &n, &m);
    for(int i = 0; i<m; ++i) {
        scanf("%d%d", &x, &y);
        e[x].push_back(y);
        e[y].push_back(x);
    }

    queue<int>  q;
    q.push(1);
    q.push(n);

    dist[1][n] = 1;
    p[1][n] = {0,0};

    while(!q.empty()) {
        int u = q.front();
        q.pop();
        int v = q.front();
        q.pop();

        if(u == v) {
            continue;
        }

        for(auto nu : e[u]) {
            for(auto nv : e[v]) {
                if(!dist[nu][nv]) {
                    dist[nu][nv] = dist[u][v]+1;
                    q.push(nu);
                    q.push(nv);
                    p[nu][nv] = {u,v};
                }
            }
        }
    }

    if(!dist[n][1]) {
        printf("-1\n");
        return 0;
    }

    int u = n,
        v = 1;

    while(u+v>1) {
        path1.push_back(u);
        path2.push_back(v);
        int nu = p[u][v].first,
            nv = p[u][v].second;
        u = nu;
        v = nv;
    }

    int res = path1.size()-1;
    printf("%d\n", res);
    for(int i = 0; i<path2.size(); ++i) {
        printf("%d ", path2[i]);
    }
    printf("\n");
    for(int i = 0; i<path1.size(); ++i) {
        printf("%d ", path1[i]);
    }
    printf("\n");

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int MAXN= 555;
int dis[MAXN][MAXN]={};
vector<int>a[MAXN],ans1,ans2;
queue<int>q;
pair<int,int>p[MAXN][MAXN];
main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    int n,m,x,y;
    cin>>n>>m;
    for(int i=0;i<m;i++)
    {
        cin>>x>>y;
        a[x].push_back(y);
        a[y].push_back(x);
    }
    dis[1][n]=1;
    q.push(1);
    q.push(n);
    int u,v;
    p[1][n]={0,0};
    while(q.size())
    {
        u=q.front();q.pop();
        v=q.front();q.pop();
        if(u==v)
           continue;
        for(auto e : a[u])
        {
            for(auto w : a[v])
            {
                if(!dis[e][w])
                {
                    dis[e][w]=dis[u][v]+1;
                    q.push(e);
                    q.push(w);
                    p[e][w]={u,v};
                }
            }
        }
    }
    if(!dis[n][1])
        return cout<<-1,0;
    u=n;
    v=1;
    while(u+v>0)
    {
        ans1.push_back(u);
        ans2.push_back(v);
        x=p[u][v].first;
        v=p[u][v].second;
        u=x;
    }
    cout<<ans1.size()-1<<endl;
    for(int i=0;i<ans1.size();i++)
        cout<<ans2[i]<<' ';
    cout<<'\n';
    for(int i=0;i<ans1.size();i++)
        cout<<ans1[i]<<' ';

}


#include<stdio.h>
#include<iostream>
#include<utility>
#include<queue>

using namespace std;

#define MAXN 505

int dist[MAXN][MAXN];
vector<int> e[MAXN],
            path1,
            path2;
pair<int, int>  p[MAXN][MAXN];

int main() {
    int n = 0,
        m = 0,
        x = 0,
        y = 0;

    scanf("%d%d", &n, &m);
    for(int i = 0; i<m; ++i) {
        scanf("%d%d", &x, &y);
        e[x].push_back(y);
        e[y].push_back(x);
    }

    queue<int>  q;
    q.push(1);
    q.push(n);
    for(int i = 1; i<=n; ++i) {
        for(int j = 1; j<=n; ++j) {
            dist[i][j] = 0;
        }
    }
    dist[1][n] = 1;
    p[1][n] = make_pair(0, 0);

    while(!q.empty()) {
        int u = q.front();
        q.pop();
        int v = q.front();
        q.pop();

        if(u == v) {
            continue;
        }

        for(auto nu : e[u]) {
            for(auto nv : e[v]) {
                if(!dist[nu][nv]) {
                    dist[nu][nv] = dist[u][v]+1;
                    q.push(nu);
                    q.push(nv);
                    p[nu][nv] = make_pair(u, v);
                }
            }
        }
    }

    if(dist[n][1]==0) {
        printf("-1\n");
        return 0;
    }

    int u = n,
        v = 1;

    while(u+v>1) {
        path1.push_back(u);
        path2.push_back(v);
        int nu = p[u][v].first,
            nv = p[u][v].second;
        u = nu;
        v = nv;
    }

    int res = path1.size()-1;
    printf("%d\n", res);
    for(int i = 0; i<path2.size(); ++i) {
        printf("%d ", path2[i]);
    }
    printf("\n");
    for(int i = 0; i<path1.size(); ++i) {
        printf("%d ", path1[i]);
    }
    printf("\n");

    return 0;
}


#include<stdio.h>
#include<iostream>
#include<utility>
#include<queue>

using namespace std;

#define MAXN 505

int dist[MAXN][MAXN][2];
vector<int> e[MAXN],
            path1,
            path2;
pair<pair<int,int>,int>  p[MAXN][MAXN][2];

int main() {
    int n = 0,
        m = 0,
        x = 0,
        y = 0;
    ios::sync_with_stdio(false);
    cin.tie(0);

    cin>>n>>m;
    for(int i = 0; i<m; ++i) {
        cin>>x>>y;
        e[x].push_back(y);
        e[y].push_back(x);
    }

    queue<pair<pair<int,int>,int>>  q;
    q.push(make_pair(make_pair(1,n),0));

    dist[1][n][0] = 1;

    while(!q.empty()) {
        auto uv = q.front();
        q.pop();
        int u = uv.first.first;
        int v = uv.first.second;
        int t = uv.second;

        if(!t) {
            for(auto nu : e[u]) {
                if(dist[nu][v][1] == 0) {
                    dist[nu][v][1] = dist[u][v][0];
                    p[nu][v][1] = uv;
                    q.push(make_pair(make_pair(nu, v),1));
                }
            }
        }
        else {
            for(auto nv : e[v]) {
                if(nv == u || dist[u][nv][0]!=0) {
                    continue;
                }

                dist[u][nv][0] = dist[u][v][1]+1;
                p[u][nv][0] = uv;
                q.push(make_pair(make_pair(u, nv), 0));
            }
        }
    }

    if(!dist[n][1][0]) {
        printf("-1\n");
        return 0;
    }

    int res = dist[n][1][0];

    printf("%d\n", res-1);
    int u = n,
        v = 1;
    while(res--) {
        path1.push_back(u);
        path2.push_back(v);
        for(int i = 0; i<2; ++i) {
            auto tmp = p[u][v][i];
            u = tmp.first.first;
            v = tmp.first.second;
        }
    }

    for(int i = 0; i<path2.size(); ++i) {
        printf("%d ", path2[i]);
    }
    printf("\n");
    for(int i = 0; i<path1.size(); ++i) {
        printf("%d ", path1[i]);
    }
    printf("\n");

    return 0;
}


#include<stdio.h>
#include<iostream>
#include<utility>
#include<queue>

using namespace std;

#define MAXN 505

int dist[MAXN][MAXN];
vector<int> e[MAXN],
            path1,
            path2;
pair<int, int>  p[MAXN][MAXN];

int main() {
    int n = 0,
        m = 0,
        x = 0,
        y = 0;

    scanf("%d%d", &n, &m);
    for(int i = 0; i<m; ++i) {
        scanf("%d%d", &x, &y);
        e[x].push_back(y);
        e[y].push_back(x);
    }

    queue<int>  q;
    q.push(1);
    q.push(n);

    dist[1][n] = 1;
    p[1][n] = {0,0};

    while(!q.empty()) {
        int u = q.front();
        q.pop();
        int v = q.front();
        q.pop();

        if(u == v) {
            continue;
        }

        for(auto nu : e[u]) {
            for(auto nv : e[v]) {
                if(!dist[nu][nv]) {
                    dist[nu][nv] = dist[u][v]+1;
                    q.push(nu);
                    q.push(nv);
                    p[nu][nv] = {u,v};
                }
            }
        }
    }

    if(!dist[n][1]) {
        printf("-1\n");
        return 0;
    }

    int u = n,
        v = 1;

    while(u+v>1) {
        path1.push_back(u);
        path2.push_back(v);
        int nu = p[u][v].first,
            v = p[u][v].second;
        u = nu;
    }

    int res = path1.size()-1;
    printf("%d\n", res);
    for(int i = 0; i<path2.size(); ++i) {
        printf("%d ", path2[i]);
    }
    printf("\n");
    for(int i = 0; i<path1.size(); ++i) {
        printf("%d ", path1[i]);
    }
    printf("\n");

    return 0;
}


/**
 * ******* Created  on 10/3/20 3:59 PM*******
 */

import java.io.*;
import java.util.*;

public class A29 implements Runnable {

    private static final int MAX = (int) (1E5 + 5);
    private static final int MOD = (int) (1E9 + 7);
    private static final long Inf = (long) (1E14 + 10);

    private void solve() throws IOException {
        int n = reader.nextInt();

        boolean flag =false;
        int[] x =new int[105];
        int[] d =new int[105];
        for(int i=0;i<n;i++){
            x[i] = reader.nextInt();
            d[i] = reader.nextInt();
        }
        for(int i=0;i<n;i++){
            int a = x[i]+d[i];
            for(int j=0;j<n;j++){
                if(i==j)continue;
                if( (a == x[j]) && (x[j]+d[j]==x[i]))
                    flag =true;
            }
        }
        if(flag)
            writer.println("YES");
        else
            writer.println("NO");

    }

    public static void main(String[] args) throws IOException {
        try (Input reader = new StandardInput(); PrintWriter writer = new PrintWriter(System.out)) {
            new A29().run();
        }
    }

    StandardInput reader;
    PrintWriter writer;

    @Override
    public void run() {
        try {
            reader = new StandardInput();
            writer = new PrintWriter(System.out);
            solve();
            reader.close();
            writer.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    interface Input extends Closeable {
        String next() throws IOException;

        default int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        default long nextLong() throws IOException {
            return Long.parseLong(next());
        }

        default double nextDouble() throws IOException {
            return Double.parseDouble(next());
        }

        default int[] readIntArray() throws IOException {
            return readIntArray(nextInt());
        }

        default int[] readIntArray(int size) throws IOException {
            int[] array = new int[size];
            for (int i = 0; i < array.length; i++) {
                array[i] = nextInt();
            }
            return array;
        }

        default long[] readLongArray(int size) throws IOException {
            long[] array = new long[size];
            for (int i = 0; i < array.length; i++) {
                array[i] = nextLong();
            }
            return array;
        }
    }

    private static class StandardInput implements Input {
        private final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));

        private StringTokenizer stringTokenizer;

        @Override
        public void close() throws IOException {
            reader.close();
        }

        @Override
        public String next() throws IOException {
            if (stringTokenizer == null || !stringTokenizer.hasMoreTokens()) {
                stringTokenizer = new StringTokenizer(reader.readLine());
            }
            return stringTokenizer.nextToken();
        }
    }
}


/**
 * ******* Created  on 10/3/20 3:59 PM*******
 */

import java.io.*;
import java.util.*;

public class A29 implements Runnable {

    private static final int MAX = (int) (1E5 + 5);
    private static final int MOD = (int) (1E9 + 7);
    private static final long Inf = (long) (1E14 + 10);

    private void solve() throws IOException {
        int n = reader.nextInt();
        Map<Integer, Integer> map = new HashMap<>();
        boolean flag =false;
        for(int i=0;i<n;i++){
            int x = reader.nextInt();
            int d = reader.nextInt();

            if(map.containsKey(x)){
                flag =true;
            }
            map.put(x+d,1);
            map.put(x-d,1);
        }
        if(flag)
            writer.println("YES");
        else
            writer.println("NO");

    }

    public static void main(String[] args) throws IOException {
        try (Input reader = new StandardInput(); PrintWriter writer = new PrintWriter(System.out)) {
            new A29().run();
        }
    }

    StandardInput reader;
    PrintWriter writer;

    @Override
    public void run() {
        try {
            reader = new StandardInput();
            writer = new PrintWriter(System.out);
            solve();
            reader.close();
            writer.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    interface Input extends Closeable {
        String next() throws IOException;

        default int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        default long nextLong() throws IOException {
            return Long.parseLong(next());
        }

        default double nextDouble() throws IOException {
            return Double.parseDouble(next());
        }

        default int[] readIntArray() throws IOException {
            return readIntArray(nextInt());
        }

        default int[] readIntArray(int size) throws IOException {
            int[] array = new int[size];
            for (int i = 0; i < array.length; i++) {
                array[i] = nextInt();
            }
            return array;
        }

        default long[] readLongArray(int size) throws IOException {
            long[] array = new long[size];
            for (int i = 0; i < array.length; i++) {
                array[i] = nextLong();
            }
            return array;
        }
    }

    private static class StandardInput implements Input {
        private final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));

        private StringTokenizer stringTokenizer;

        @Override
        public void close() throws IOException {
            reader.close();
        }

        @Override
        public String next() throws IOException {
            if (stringTokenizer == null || !stringTokenizer.hasMoreTokens()) {
                stringTokenizer = new StringTokenizer(reader.readLine());
            }
            return stringTokenizer.nextToken();
        }
    }
}


/* package codechef; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
public class Codechef
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner ob=new Scanner(System.in);
		int n=ob.nextInt();
	    int a[]=new int[n];
		int b[]=new int[n];
		int f=0;
		for(int i=0;i<n;i++)
		{
		    a[i]=ob.nextInt();
		    b[i]=ob.nextInt();
		}
		for(int i=0;i<n;i++)
		{
		    for(int j=0;j<n-1;j++)
		    {
		           if(j==i)
		                continue;
		    if(a[i]+b[i]==a[j] && a[j]+b[j]==a[i])
		    {

		        f=1;
		        break;
		    }

		    }

		}
	    if(f==1)
	    System.out.println("YES");
	    else
	    System.out.println("NO");
	}
}


/* package codechef; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
public class Codechef
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner ob=new Scanner(System.in);
		int n=ob.nextInt();
	    int a[]=new int[n];
		int b[]=new int[n];
		int c[]=new int[n];
		int f=0;
		for(int i=0;i<n;i++)
		{
		    a[i]=ob.nextInt();
		    b[i]=ob.nextInt();
		    c[i]=a[i]+b[i];
		}
		for(int i=0;i<n-1;i++)
		{
		    for (int j=1;j<i;j++ )
		    {
    		    if(a[i+1]==c[j])
    		    {

    		        f=1;
    		        break;
    		    }
		    }
		}
	    if(f==1)
	    System.out.println("YES");
	    else
	    System.out.println("NO");
	}
}


/* package codechef; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
 public class Codechef
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner ob=new Scanner(System.in);
		int n=ob.nextInt();
	    int a[]=new int[n];
		int b[]=new int[n];
		int f=0;
		for(int i=0;i<n;i++)
		{
		    a[i]=ob.nextInt();
		    b[i]=ob.nextInt();
		}
		for(int i=0;i<n-1;i++)
		{
		    for(int j=0;j<n;j++)
		    {
		           if(j==i+1)
		                j++;
		           if(j==n)
		           break;
		    if(a[i+1]+b[i+1]==a[j]+b[j])
		    {

		        f=1;
		        break;
		    }

		    }

		}
	    if(f==1)
	    System.out.println("YES");
	    else
	    System.out.println("NO");
	}
}


/* package codechef; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
 public class Codechef
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner ob=new Scanner(System.in);
		int n=ob.nextInt();
	    int a[]=new int[n];
		int b[]=new int[n];
		int c[]=new int[n];
		int f=0;
		for(int i=0;i<n;i++)
		{
		    a[i]=ob.nextInt();
		    b[i]=ob.nextInt();
		    c[i]=a[i]+b[i];
		}
		for(int i=0;i<n-1;i++)
		{
		    for (int j=0;j<n ;j++ )
		    {
    		    if(a[i+1]==c[j])
    		    {

    		        f=1;
    		        break;
    		    }
		    }
		}
	    if(f==1)
	    System.out.println("YES");
	    else
	    System.out.println("NO");
	}
}


/* package codechef; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
public class Codechef
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner ob=new Scanner(System.in);
		int n=ob.nextInt();
	    int a[]=new int[n];
		int b[]=new int[n];
		int f=0;
		for(int i=0;i<n;i++)
		{
		    a[i]=ob.nextInt();
		    b[i]=ob.nextInt();
		}
		for(int i=0;i<n-1;i++)
		{
		    if(a[i+1]+b[i+1]==a[i])
		    {
		        f=1;
		        break;
		    }
		}
	    if(f==1)
	    System.out.println("YES");
	    else
	    System.out.println("NO");
	}
}


import java.io.*;
import java.util.*;
public class camel_spit
{
    public static void main(String[] args) throws IOException
    {
    BufferedReader br=new BufferedReader(new BufferedReader(new InputStreamReader(System.in)));
    int x=Integer.parseInt(br.readLine());
    int[] d=new int[x];
    int[] d1=new int[x];
    for(int i=0;i<x;i++)
    {String[] x1=br.readLine().split(" ");
    d[i]=Integer.parseInt(x1[0]);
    d1[i]=Integer.parseInt(x1[0])+Integer.parseInt(x1[1]);
    }
    for(int g=0;g<x;g++)
    {
        int pro=d[g];
        int pro1=d1[g];
        for(int c=0;c<x;c++)
        {
            if(d1[c]==pro)
            {
                int vb=c;
                if(d[vb]==pro1)
                    {System.out.println("YES");return;
                    }

            }
        }}
        System.out.println("NO");
    }

}


import java.io.BufferedReader;
import java.util.Scanner;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;
import java.math.BigInteger;
public class A29
{
	static Scanner sc = new Scanner(System.in);
	static PrintWriter out = new PrintWriter(System.out);

	static void pn(Object o) {
		out.println(o);
		out.flush();

	}

	static void p(Object o) {
		out.print(o);
		out.flush();
	}

	static void pni(Object o) {
		out.println(o);
		System.out.flush();
	}

	static int I() throws IOException {
		return sc.nextInt();
	}

	static long L() throws IOException {
		return sc.nextLong();
	}

	static double D() throws IOException {
		return sc.nextDouble();
	}

	static String S() throws IOException {
		return sc.nextLine();
	}

	static char C() throws IOException {
		return sc.next().charAt(0);
	}
	static int[] Ai(int n) throws IOException {
		int[] arr = new int[n];

		for (int i = 0; i < n; i++)
			arr[i] = I();

		return arr;
	}

	static String[] As(int n) throws IOException {
		String s[] = new String[n];

		for (int i = 0; i < n; i++)
			s[i] = S();

		return s;
	}

	static long[] Al(int n) throws IOException {
		long[] arr = new long[n];

		for (int i = 0; i < n; i++)
			arr[i] = L();

		return arr;
	}
	public static void process() throws IOException
	{
	     int n=I();
	     HashMap<Integer,Integer> map=new HashMap<Integer,Integer>();
	     boolean flag=false;
	     for(int i=0;i<n;i++)
	     {
	    	 int x=I();
	    	 int y=I();
	    	 if(map.containsKey(x+y))
	    	 {
	    		 int t=map.get(x+y);
	    	 if(t==x)
	    	 {
	    		 flag=true;
	    	     break;
	    	 }

	    	 }

	    	 else
	    	 map.put(x,x+y);
	     }
	     if(flag==true)
	     {
	    	 pn("YES");
	     }
	     else
	     {
	    	 pn("NO");

	     }
	}
	public static void main(String[] args) throws IOException {

		process();

	}

}


import java.io.*;
import java.util.*;
public class cross
{
	public static void main(String args[]) throws IOException
	{
		try{
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		int n=0;
		n=Integer.parseInt(br.readLine());
		ArrayList<Integer> brr=new ArrayList<Integer>();
		HashSet<Integer> asd=new HashSet<Integer>();
		while(n!=0)
		{
			String as[]=br.readLine().split(" ");
			brr.add(Integer.parseInt(as[0]));
			asd.add(Integer.parseInt(as[1])+Integer.parseInt(as[0]));
			--n;
		}
		ArrayList<Integer> spit=new ArrayList<Integer>(asd);
		int ans=0;
		for(int i=0;i<spit.size();i++)
		{
			if(brr.contains(spit.get(i))==true)
			{
				ans+=1;
			}
		}
		if(ans==2)
		{
			System.out.println("YES");
		}
		else
		{
			System.out.println("NO");
		}
	}
	catch(Exception e){}
}}


import java.io.*;
import java.util.*;
public class cross
{
	public static void main(String args[]) throws IOException
	{
		try{
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		int n=0;
		n=Integer.parseInt(br.readLine());
		ArrayList<Integer> brr=new ArrayList<Integer>();
		HashSet<Integer> as=new HashSet<Integer>();
		while(n!=0)
		{
			String as[]=br.readLine().split(" ");
			brr.add(Integer.parseInt(as[0]));
			as.add(Integer.parseInt(as[1])+Integer.parseInt(as[0]));
			--n;
		}
		ArrayList<Integer> spit=new ArrayList<Integer>(as);
		int ans=0;
		for(int i=0;i<spit.size();i++)
		{
			if(brr.contains(spit.get(i))==true)
			{
				ans+=1;
			}
		}
		if(ans==2)
		{
			System.out.println("YES");
		}
		else
		{
			System.out.println("NO");
		}
	}
	catch(Exception e){}
}}


import java.io.*;
import java.util.*;
public class cross
{
	public static void main(String args[]) throws IOException
	{
		try{
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		int n=0;
		n=Integer.parseInt(br.readLine());
		ArrayList<Integer> brr=new ArrayList<Integer>();
		ArrayList<Integer> spit=new ArrayList<Integer>();
		while(n!=0)
		{
			String as[]=br.readLine().split(" ");
			brr.add(Integer.parseInt(as[0]));
			spit.add(Integer.parseInt(as[1])+Integer.parseInt(as[0]));
			--n;
		}
		int ans=0;
		for(int i=0;i<spit.size();i++)
		{
			if(brr.contains(spit.get(i))==true)
			{
				ans+=1;
			}
		}
		if(ans==2)
		{
			System.out.println("YES");
		}
		else
		{
			System.out.println("NO");
		}
	}
	catch(Exception e){}
}}


import java.io.*;
import java.util.*;
public class hang
{
	public static void main(String args[]) throws IOException
	{
		try{
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		int n=0;
		n=Integer.parseInt(br.readLine());
		int arr[]=new int[n];
		int brr[]=new int[n];
		int cou_ar=0;int cou_br=0;
		while(n!=0)
		{
			String as[]=br.readLine().split(" ");
			arr[cou_ar++]=Integer.parseInt(as[0]);
			brr[cou_br++]=Integer.parseInt(as[1]);
			--n;
		}
		int ans=0;
		for(int i=0;i<arr.length;i++)
		{
			for(int j=0;j<arr.length;j++)
			{
				if((arr[i]+brr[i])==arr[j] && j!=i)
				{
					if(arr[j]+brr[j]==arr[i])
					{
					ans+=1;
				    }
				}
			}
		}
		if(ans>=2)
		{
			System.out.println("YES");
		}
		else
		{
			System.out.println("NO");
		}
	}
	catch(Exception e){}
}}


import java.util.*;
public class SpitProblem {

    static Map<Integer,Integer> s = new HashMap<Integer,Integer>();

    static void solve(){
        Scanner sc = new Scanner(System.in);
        int NOC = sc.nextInt();
        boolean end = false;
        while(NOC-->0) s.put(sc.nextInt(),sc.nextInt());
        for(Map.Entry<Integer,Integer> e: s.entrySet()){
            int k = e.getKey(); int v = e.getValue();
            int key  = k+v;
            if(s.containsKey(key)) if((s.get(key)+(key))==k) { end = true; break;}
        }
        System.out.println((end) ? "YES" : "NO");
        sc.close();
    }

    public static void main(String args[]) {
        solve();
    }
}


import java.io.*;
import java.util.*;
public class cf {
	public static void main(String[] args) throws Exception {

		//BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] x = new int[n];
		int[] d = new int[n];
		int[] spit = new int[n];

		for(int i=0;i<n;i++)
		{
			x[i] = sc.nextInt();
			d[i] = sc.nextInt();
			spit[i] = x[i]+d[i];
		}

		for(int i=0;i<n;i++)
		{
			for(int j=0;j<n;j++)
			{
				if(spit[j] == x[i] && spit[i] == x[j])
				{
					System.out.println("YES");
					System.exit(0);
				}
			}
		}

		System.out.println("NO");
	}
}


import java.io.IOException;

import java.util.*;

/**
 *
 * @author DELL
 */
public class JavaApplication3 {

    /**
     * @param args the command line arguments
     */

     public static void main(String[] args) throws IOException {
        Scanner sc=new Scanner(System.in);
         int n=sc.nextInt();
         int a[][]=new int[n][2];
         //int ans[]=new int[n];
         for(int i=0;i<n;i++){
             for(int j=0;j<2;j++){
                 a[i][j]=sc.nextInt();
             }
             //ans[i]=a[i][0]+a[i][1];
         }
         String s="NO";
         for(int i=0;i<n;i++){
             for(int j=0;j<n;j++){
                 if(i!=j && a[i][0]+a[i][1]==a[j][0] && a[j][0]+a[j][1]==a[i][0]){
                     s="YES";
                     break;
                 }
             }
         }
         System.out.println(s);
     }
}


import java.io.*;
import java.math.BigInteger;
import java.util.*;

public class solution {
    public static void merge(int arr[], int l, int m, int r) {
        int n1 = m - l + 1;
        int n2 = r - m;
        int L[] = new int[n1];
        int R[] = new int[n2];
        for (int i = 0; i < n1; ++i)
            L[i] = arr[l + i];
        for (int j = 0; j < n2; ++j)
            R[j] = arr[m + 1 + j];

        int i = 0, j = 0;

        int k = l;
        while (i < n1 && j < n2) {
            if (L[i] <= R[j]) {
                arr[k] = L[i];
                i++;
            } else {
                arr[k] = R[j];
                j++;
            }
            k++;
        }

        while (i < n1) {
            arr[k] = L[i];
            i++;
            k++;
        }

        while (j < n2) {
            arr[k] = R[j];
            j++;
            k++;
        }
    }

    public static void sort(int arr[], int l, int r) {
        if (l < r) {
            int m = (l + r) / 2;

            sort(arr, l, m);
            sort(arr, m + 1, r);

            merge(arr, l, m, r);
        }
    }
   public static int Prec(char ch)
    {
        switch (ch)
        {
            case '+':
            case '-':
                return 1;

            case '*':
            case '/':
                return 2;

            case '^':
                return 3;
        }
        return -1;
    }

    // The main method that converts given infix expression
    // to postfix expression.
   public static String infixToPostfix(String exp)
    {
        // initializing empty String for result
        String result = new String("");

        // initializing empty stack
        Stack<Character> stack = new Stack<>();

        for (int i = 0; i<exp.length(); ++i)
        {
            char c = exp.charAt(i);

            // If the scanned character is an operand, add it to output.
            if (Character.isLetterOrDigit(c))
                result += c;

                // If the scanned character is an '(', push it to the stack.
            else if (c == '(')
                stack.push(c);

                //  If the scanned character is an ')', pop and output from the stack
                // until an '(' is encountered.
            else if (c == ')')
            {
                while (!stack.isEmpty() && stack.peek() != '(')
                    result += stack.pop();

                if (!stack.isEmpty() && stack.peek() != '(')
                    return "Invalid Expression"; // invalid expression
                else
                    stack.pop();
            }
            else // an operator is encountered
            {
                while (!stack.isEmpty() && Prec(c) <= Prec(stack.peek())){
                    if(stack.peek() == '(')
                        return "Invalid Expression";
                    result += stack.pop();
                }
                stack.push(c);
            }

        }

        // pop all the operators from the stack
        while (!stack.isEmpty()){
            if(stack.peek() == '(')
                return "Invalid Expression";
            result += stack.pop();
        }
        return result;
    }
    static class comp implements Comparator<ArrayList<Integer>> {
        public int compare(ArrayList<Integer> a, ArrayList<Integer> b) {
            return (a.get(0) - b.get(0));
        }
    }
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        int x[] = new int[n];
        int d[] = new int[n];
        for(int i=0;i<n;i++){
            StringTokenizer st = new StringTokenizer(br.readLine());
            x[i] = Integer.parseInt(st.nextToken());
            d[i] = Integer.parseInt(st.nextToken());
        }
        boolean flag = false;
        for(int i=0;i<n;i++){
            int pos = x[i]+d[i];
            for(int j=0;j<n;j++){
                if(x[j] == pos){
                    int pos1 = x[j]+d[j];
                    if(pos1 == x[i]){
                        flag = true;
                        break;
                    }
                }
            }
        }
        if(flag){
            System.out.println("YES");
        }
        else{
            System.out.println("NO");
        }
    }
}


import java.util.ArrayList;
import java.util.Scanner;

public class Spin_Mohamed {

    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();

        ArrayList<Camel> list = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            list.add(new Camel(scanner.nextInt(), scanner.nextInt(), i, null, null));
        }

        for (int i = 0; i < list.size(); i++) {

            if (list.get(i).spat > 0) {

                int coveredDistance = list.get(i).position + list.get(i).spat;
                for (int j = 0; j < list.size(); j++) {

                    if ((coveredDistance >= list.get(j).position) && (list.get(j).position > list.get(i).position)) {

                        list.get(j).hitFrom = list.get(i).camelID;
                        list.get(i).spatOn = list.get(j).camelID;

                    }

                }
            } else {

                int coveredDistance = list.get(i).position + list.get(i).spat;
                for (int j = 0; j < list.size(); j++) {

                    if ((coveredDistance >= list.get(j).position) && (list.get(j).position < list.get(i).position)) {

                        int x = 1;//TODO DELETE me
                        list.get(j).hitFrom = list.get(i).camelID;
                        list.get(i).spatOn = list.get(j).camelID;

                    }

                }

            }

        }

        for(int i=0;i<list.size();i++){
            for(int j=0;j<list.size();j++){

                if((list.get(i).spatOn == list.get(j).hitFrom) && (list.get(j).spatOn == list.get(i).hitFrom)){

                    if(list.get(i).spatOn == null || list.get(i).hitFrom == null || list.get(j).spatOn == null || list.get(j).hitFrom == null){}
                    else {
                        System.out.println("Yes");
                        return;
                    }
                }

            }
        }

        System.out.println("No");

    }

    static class Camel {

        public int position;
        public int spat;
        public Integer camelID;
        public Integer hitFrom;
        public Integer spatOn;

        public Camel(int position, int spat, Integer camelID, Integer hitFrom, Integer spatOn) {
            this.position = position;
            this.spat = spat;
            this.camelID = camelID;
            this.hitFrom = hitFrom;
            this.spatOn = spatOn;
        }
    }

}


import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Spit_Mohamed {

    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();

        ArrayList<Camel> list = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            list.add(new Camel(scanner.nextInt(), scanner.nextInt()));
        }

        Collections.sort(list); //sorting list

        //Left Spits
        for (int i = list.size() - 1; i > 0; i--) {

            int coveredDistance = list.get(i).spat + list.get(i).position;
            for (int j = i - 1; j >= 0; j--) {

                if (coveredDistance == list.get(j).position)
                    list.get(i).spatOn = String.valueOf(list.get(j).position);

            }
        }

        //Right spits
        for (int i = 0; i < list.size() - 1; i++) {

            int coveredDistance = list.get(i).position + list.get(i).spat;
            for (int j = i + 1; j < list.size(); j++) {

                if (coveredDistance == list.get(j).position)
                    list.get(i).spatOn = String.valueOf(list.get(j).position);

            }

        }

        for (int i = 0; i < list.size(); i++) {
            for (int j = 0; j < list.size(); j++){

                if(list.get(i) == list.get(j)){}
                else{
                    if(!list.get(i).spatOn.equals("") && !list.get(j).spatOn.equals(""))
                    if((Integer.parseInt(list.get(i).spatOn) == list.get(j).position) && (Integer.parseInt(list.get(j).spatOn) == list.get(i).position)){
                        System.out.println("Yes");
                        return;
                    }
                }

            }
        }

        System.out.println("No");

        //Printing the loop
//        for (int i = 0; i < list.size(); i++)
//            System.out.println(list.get(i).toString());

    }

    static class Camel implements Comparable<Camel> {

        int position;
        int spat;
        String spatOn;

        public Camel(int position, int spat) {
            this.position = position;
            this.spat = spat;
            this.spatOn = "";
        }

        @Override
        public String toString() {
            return "Camel{" +
                    "position=" + position +
                    ", spat=" + spat +
                    ", spatOn='" + spatOn + '\'' +
                    '}';
        }

        @Override
        public int compareTo(Camel o) {
            if (position > o.position)
                return 1;
            else if (position < o.position)
                return -1;
            else
                return 0;
        }
    }

}


import java.util.ArrayList;
import java.util.Scanner;

public class Spin_Mohamed {

    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();

        ArrayList<Camel> list = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            list.add(new Camel(scanner.nextInt(), scanner.nextInt(), i, null, null));
        }

        for (int i = 0; i < list.size(); i++) {

            if (list.get(i).spat > 0) {

                int coveredDistance = list.get(i).position + list.get(i).spat;
                for (int j = 0; j < list.size(); j++) {

                    if ((coveredDistance >= list.get(j).position) && (list.get(j).position > list.get(i).position)) {

                        list.get(j).hitFrom = list.get(i).camelID;
                        list.get(i).spatOn = list.get(j).camelID;

                    }

                }
            } else {

                int coveredDistance = list.get(i).position + list.get(i).spat;
                for (int j = 0; j < list.size(); j++) {

                    if ((coveredDistance >= list.get(j).position) && (list.get(j).position < list.get(i).position)) {

                        list.get(j).hitFrom = list.get(i).camelID;
                        list.get(i).spatOn = list.get(j).camelID;

                    }

                }

            }

        }

        for(int i=0;i<list.size();i++){
            for(int j=0;j<list.size();j++){

                if((list.get(i).spatOn == list.get(j).hitFrom) && (list.get(j).spatOn == list.get(i).hitFrom)){

                    if(list.get(i).spatOn == null || list.get(i).hitFrom == null || list.get(j).spatOn == null || list.get(j).hitFrom == null){}
                    else {
                        System.out.println("Yes");
                        return;
                    }
                }

            }
        }

        System.out.println("No");

    }

    static class Camel {

        public int position;
        public int spat;
        public Integer camelID;
        public Integer hitFrom;
        public Integer spatOn;

        public Camel(int position, int spat, Integer camelID, Integer hitFrom, Integer spatOn) {
            this.position = position;
            this.spat = spat;
            this.camelID = camelID;
            this.hitFrom = hitFrom;
            this.spatOn = spatOn;
        }
    }

}


import java.util.ArrayList;
import java.util.Scanner;

public class Spin_Mohamed {

    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();

        ArrayList<Camel> list = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            list.add(new Camel(scanner.nextInt(), scanner.nextInt(), i, null, null));
        }

        for (int i = 0; i < list.size(); i++) {

            if (list.get(i).spat > 0) {

                int coveredDistance = list.get(i).position + list.get(i).spat;
                for (int j = 0; j < list.size(); j++) {

                    if ((coveredDistance >= list.get(j).position) && (list.get(j).position > list.get(i).position)) {

                        list.get(j).hitFrom = list.get(i).camelID;
                        list.get(i).spatOn = list.get(j).camelID;
                        break;

                    }

                }
            } else {

                int coveredDistance = list.get(i).position + list.get(i).spat;
                for (int j = 0; j < list.size(); j++) {

                    if ((coveredDistance >= list.get(j).position) && (list.get(j).position < list.get(i).position)) {

                        list.get(j).hitFrom = list.get(i).camelID;
                        list.get(i).spatOn = list.get(j).camelID;
                        break;
                    }

                }

            }

        }

        for(int i=0;i<list.size();i++){
            for(int j=0;j<list.size();j++){

                if((list.get(i).spatOn == list.get(j).hitFrom) && (list.get(j).spatOn == list.get(i).hitFrom)){

                    if(list.get(i).spatOn == null || list.get(i).hitFrom == null || list.get(j).spatOn == null || list.get(j).hitFrom == null){}
                    else {
                        System.out.println("Yes");
                        return;
                    }
                }

            }
        }

        System.out.println("No");

    }

    static class Camel {

        public int position;
        public int spat;
        public Integer camelID;
        public Integer hitFrom;
        public Integer spatOn;

        public Camel(int position, int spat, Integer camelID, Integer hitFrom, Integer spatOn) {
            this.position = position;
            this.spat = spat;
            this.camelID = camelID;
            this.hitFrom = hitFrom;
            this.spatOn = spatOn;
        }
    }

}


import java.util.ArrayList;
import java.util.Scanner;

public class ForgottenEpisode_Mohamed {

    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();

        ArrayList<Integer> list = new ArrayList<>();
        for (int i = 0; i < n-1; i++) {
            list.add(scanner.nextInt());
        }

        for (int i = 1; i <= n; i++){
            if(!list.contains(i)){
                System.out.println(i);
                return;
            }
        }

    }
}


import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;

public class Spin_Mohamed {

    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();

        ArrayList<Camel> list = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            list.add(new Camel(scanner.nextInt(), scanner.nextInt(), i, null, null));
        }

        Collections.sort(list);

        for (int i = 0; i < list.size(); i++) {

            if (list.get(i).spat > 0) {

                int coveredDistance = list.get(i).position + list.get(i).spat;
                for (int j = 0; j < list.size(); j++) {

                    if ((coveredDistance >= list.get(j).position) && (list.get(j).position > list.get(i).position)) {

                        list.get(j).hitFrom = list.get(i).camelID;
                        list.get(i).spatOn = list.get(j).camelID;

                    }

                }
            } else {

                int coveredDistance = list.get(i).position + list.get(i).spat;
                for (int j = 0; j < list.size(); j++) {

                    if ((coveredDistance >= list.get(j).position) && (list.get(j).position < list.get(i).position)) {

                        list.get(j).hitFrom = list.get(i).camelID;
                        list.get(i).spatOn = list.get(j).camelID;

                    }

                }

            }

        }

        for(int i=0;i<list.size();i++){
            for(int j=0;j<list.size();j++){

                if((list.get(i).spatOn == list.get(j).hitFrom) && (list.get(j).spatOn == list.get(i).hitFrom)){

                    if(list.get(i).spatOn == null || list.get(i).hitFrom == null || list.get(j).spatOn == null || list.get(j).hitFrom == null){}
                    else {
                        System.out.println("Yes");
                        return;
                    }
                }

            }
        }

        System.out.println("No");

    }

    static class Camel implements Comparable<Camel> {

        public int position;
        public int spat;
        public Integer camelID;
        public Integer hitFrom;
        public Integer spatOn;

        public Camel(int position, int spat, Integer camelID, Integer hitFrom, Integer spatOn) {
            this.position = position;
            this.spat = spat;
            this.camelID = camelID;
            this.hitFrom = hitFrom;
            this.spatOn = spatOn;
        }

        @Override
        public int compareTo(Camel o) {
            if (position > o.position)
                return 1;
            else if (position < o.position)
                return -1;
            else
                return 0;
        }
    }

}


#include<bits/stdc++.h>
#define REP(i,a,b) for(int i=a;i<b;i++)

using namespace std;
int a[1000],b[1000];
int main(){
    int n,ans=0,c;
    cin>>n;
   REP(i,0,n){
    cin>>a[i]>>b[i];
   }
    REP(i,0,n-1){
    if(a[i]+b[i]==a[i+1]&&a[i+1]+b[i+1]==a[i]) ans=1;
    }
   cout<<((ans==1)?"YES\n":"NO\n");
    return 0;
}


#include<bits/stdc++.h>
#define REP(i,a,b) for(int i=a;i<b;i++)

using namespace std;
int a[1000],b[1000];
int main(){
    int n,ans=0,c;
    cin>>n;
   REP(i,0,n){
    cin>>a[i]>>b[i];
   }
    REP(i,0,n-1){
        c=a[i]+b[i];
        REP(j,1,n){
    if(c==a[j]&&a[j]+b[j]==a[i]) ans=1;
    }
    }
   cout<<((ans==1)?"YES\n":"NO\n");
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,x[100],b[100],f=0;
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cin>>x[i]>>b[i];
		for(int j=0;j<i;j++)
		{
			if(x[i]+b[i]==x[j]&&x[j]+b[j]==x[i])
			{
				f=1;
				break;
			}
		}
		if(f==0)
			break;
	}
	if(f==0)
		cout<<"YES"<<endl;
	else
		cout<<"NO"<<endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,x[100],b[100];
	cin>>n;
	bool f=false;
	for(int i=0;i<n;i++)
	{
		cin>>x[i]>>b[i];
		for(int j=0;j<i;j++)
		{
			if(x[i]+b[i]==x[j]&&x[j]+b[j]==x[i])
			{
				f=true;
				break;
			}
		}
		if(f)
			break;
	}
	printf(f ? "YES\n" : "NO\n");
	return 0;
}


#include<bits/stdc++.h>

using namespace std;
typedef long long int ll;
typedef pair<int, int> pi;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
#define all(x) (x).begin(), (x).end()
#define endl "\n"
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
const ll mod = 1e9 + 7;
const ll inf = 2e9 + 5;
double PI = 3.14159265358979323846;

map<int,int> pos;

void solve() {

    int n;
    cin >> n;
    vector<pi> v;
    for (int i = 0; i < n; i++) {
        int a, b;
        cin >> a >> b;
        v.pb({a,b});
        pos[a] = b;
    }

    for(auto p : v){
        int frst = p.F;
        int spit = p.S+p.F;
        if(spit >= -10000 and spit <= 10000){
            if(pos[spit]+spit==frst){
                cout << "YES" << endl;
                return;
            }
        }

    }
    cout << "NO" << endl;

}

int32_t main()
{

    IOS

    int T;
    T = 1;
    //cin >> T;
    while (T--) {
        solve();
    }

}


#include<bits/stdc++.h>

using namespace std;
typedef long long int ll;
typedef pair<int, int> pi;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
#define all(x) (x).begin(), (x).end()
#define endl "\n"
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
const ll mod = 1e9 + 7;
const ll inf = 2e9 + 5;
double PI = 3.14159265358979323846;

vi pos(100000);

void solve() {

    int n;
    cin >> n;
    vector<pi> v;
    for (int i = 0; i < n; i++) {
        int a, b;
        cin >> a >> b;
        v.pb({a,b});
        pos[a] = b;
    }

    for(auto p : v){
        int frst = p.F;
        int spit = p.S+p.F;
        if(spit >= -10000 and spit <= 10000){
            if(pos[spit]+spit==frst){
                cout << "YES" << endl;
                return;
            }
        }

    }
    cout << "NO" << endl;

}

int32_t main()
{

    IOS

    int T;
    T = 1;
    //cin >> T;
    while (T--) {
        solve();
    }

}


#include<bits/stdc++.h>
using namespace std;
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif
	int n;
	cin >> n;
	int a[n], d[n];
	for(int i=0; i<n; i++){
		cin >> a[i] >> d[i];
	}
	bool ans = false;
	for(int i=0; i<n; i++){
		int t = a[i] + d[i];
		for(int j=0; j<n; j++){
			if(t == a[j] && a[j] + d[j] == a[i]){
				ans = true;
			}
		}
	}
	if(ans)
		cout << "YES" << endl;
	else
		cout << "NO" << endl;
	return 0;
	}


#include<bits/stdc++.h>
using namespace std;
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	#ifndef ONLINE_JUDGE
		freopen("input.txt", "r", stdin);
		freopen("output.txt", "w", stdout);
	#endif
	int n;
	cin >> n;
	int a[n], d[n];
	for(int i=0; i<n; i++){
		cin >> a[i] >> d[i];
	}
	bool ans = false;
	for(int i=1; i<n; i++){
		int t = a[i-1] + d[i-1];
		if(t == a[i]){
			// cout << ans << " " << t << " " << a[i] << " " << d[i] << " " << a[i-1] << endl;
			if((a[i]+d[i]+1 == a[i-1]+1)){
				ans = true;
			}
		}
	}
	if(ans)
		cout << "YES" << endl;
	else
		cout << "NO" << endl;
	return 0;
	}


#include <bits/stdc++.h>
using namespace std;
int main()
{
	int n;
	cin>>n;
	int ar[n][1];
	for(int i=0;i<n;i++)
	{
		cin>>ar[i][0]>>ar[i][1];
	}
	for(int i=0;i<n;i++)
	{
		for(int j=0;j<n;j++)
		{
			if(ar[i][0]+ar[i][1]==ar[j][0] and ar[j][0]+ar[j][1]==ar[i][0])
			{
				cout<<"YES";
				return 0;
			}
		}
	}
	cout<<"NO";
}


#include <bits/stdc++.h>
using namespace std;
int main()
{
	int n;
	cin>>n;
	int ar[n][2];
	for(int i=0;i<n;i++)
	{
		cin>>ar[i][0]>>ar[i][1];
	}
	for(int i=0;i<n;i++)
	{
		for(int j=0;j<n;j++)
		{
			if(ar[i][0]+ar[i][1]==ar[j][0] and ar[j][0]+ar[j][1]==ar[i][0])
			{
				cout<<"YES";
				return 0;
			}
		}
	}
	cout<<"NO";
}


#include <bits/stdc++.h>
#define ll long long int
using namespace std;

int main()
{
    int n;
    cin>>n;
    int x[n],d[n];
    for(int i=0;i<n;i++)
    {
        cin>>x[i]>>d[i];
    }
    bool my=false;
    for(int i=0;i<n-1;i++)
    {
        for(int j=i+1;j<n;j++)
        {
            if(x[i]+d[i]==x[j]&&x[j]+d[j]==x[i])
            {
                cout<<"YES"<<endl;
                my=true;
                break;
            }
            if(my==true)
                break;
        }
    }
    if(my==false)
        cout<<"NO"<<endl;
}


#include <bits/stdc++.h>
#define ll long long int
using namespace std;

int main()
{
    int n;
    cin>>n;
    int x[n],d[n];
    for(int i=0;i<n;i++)
    {
        cin>>x[i]>>d[i];
    }
    bool my=false;
    for(int i=0;i<n-1;i++)
    {
        for(int j=i+1;j<n;j++)
        {
            if(x[i]+d[i]==x[j]&&x[j]+d[j]==x[i])
            {
                cout<<"YES"<<endl;
                my=true;
                break;
            }
        }
        if(my==true)
            break;
    }
    if(my==false)
        cout<<"NO"<<endl;
}


#include <bits/stdc++.h>
#define ll long long int
using namespace std;

int main()
{
    int n;
    cin>>n;
    int x[n],d[n];
    for(int i=0;i<n;i++)
    {
        cin>>x[i]>>d[i];
    }
    bool my=false;
    for(int i=0;i<n-1;i++)
    {
        if(x[i]+d[i]==x[i+1]&&x[i+1]+d[i+1]==x[i])
        {
            cout<<"YES"<<endl;
            my=true;
            break;
        }
    }
    if(my==false)
        cout<<"NO"<<endl;
}


#include <bits/stdc++.h>
using namespace std;
#define FOR(i,l,r) for (int i=l;i<=r;i++)
#define FORD(i,r,l) for (int i=r;i>=l;i--)
#define ll long long
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define clr(x) memset(x, 0, sizeof(x))
#define sortall(x) sort(all(x))
#define tr(it, a) for(auto it = a.begin(); it != a.end(); it++)
#define PI 3.1415926535897932384626
typedef pair<int, int>	pii;
typedef pair<ll, ll>	pl;
typedef vector<int>		vi;
typedef vector<ll>		vl;
typedef vector<pii>		vpii;
typedef vector<pl>		vpl;
typedef vector<vi>		vvi;
typedef vector<vl>		vvl;

//=======================

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
        int n;
        cin>>n;
        int x[n],d[n],spit[n];
        memset(spit,-1,sizeof(spit));
        FOR(i,0,n-1)
        {
            cin>>x[i]>>d[i];
        }
        ll int temp;
        FOR(i,0,n-1)
        {
            int temp=x[i]+d[i];
            FOR(j,0,n-1)
            {
                if(temp == x[j])
                    spit[i]=j;
//                cout<<"at "<<i<<"we put "<<j<<endl;
            }
        }
//        cout<<endl;
//        FOR(i,0,n-1)
//        {
//            cout<<spit[i]<<" ";
//        }

        bool flag=true;
        FOR(i,0,n-1){
            if(spit[spit[i]]==i)
            {
                cout<<"YES";
                flag=false;
                break;
            }
        }
        if(flag)
        {
            cout<<"NO";
        }
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define FOR(i,l,r) for (int i=l;i<=r;i++)
#define FORD(i,r,l) for (int i=r;i>=l;i--)
#define ll long long
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define clr(x) memset(x, 0, sizeof(x))
#define sortall(x) sort(all(x))
#define tr(it, a) for(auto it = a.begin(); it != a.end(); it++)
#define PI 3.1415926535897932384626
typedef pair<int, int>	pii;
typedef pair<ll, ll>	pl;
typedef vector<int>		vi;
typedef vector<ll>		vl;
typedef vector<pii>		vpii;
typedef vector<pl>		vpl;
typedef vector<vi>		vvi;
typedef vector<vl>		vvl;

//=======================

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
        int n;
        cin>>n;
        int x[n],d[n],spit[n];
        memset(spit,-1,sizeof(spit));
        FOR(i,0,n-1)
        {
            cin>>x[i]>>d[i];
        }
        ll int temp;
        FOR(i,0,n-1)
        {
            int temp=x[i]+d[i];
            FOR(j,0,n-1)
            {
                if(temp == x[j]);
                spit[i]=j;
            }
        }
        bool flag=true;
        FOR(i,0,n-1){
            if(spit[spit[i]]==i)
            {
                cout<<"YES";
                flag=false;
                break;
            }
        }
        if(flag)
        {
            cout<<"NO";
        }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define  fast()      ios :: sync_with_stdio(false); cin.tie(0);
#define  ll             long long int
#define  ull            unsigned long long int
#define  ld             long double
#define  vi             vector<int>
#define vl              vector<long long>
#define vc              vector<char>
#define vs              vector<string>
#define vp              vector< pair<ll,ll> >
#define sl              set<long long>
#define sc              set<char>
#define sts             stack<string>
#define max_3(a,b,c)    max(a, max(b,c))
#define max_4(a,b,c,d)  max(a,max(b,max(c,d)))
#define min_3(a,b,c)    min(a, min(b,c))
#define min_4(a,b,c,d)  min(a,min(b,min(c,d)))
#define gcd(a,b)        __gcd(a,b)
#define lcm(a,b)        (a*b)/gcd(a,b)
#define pi              2*acos(0.0)
#define N               50000
ll s[2*N],y[N];
int main()
{
    fast()
    int i,n,x,d;
	cin>>n;
	for(i=0;i<n;i++)
	{
		cin>>x>>d;
		if(s[x+d+N]==-d)
		break;
		s[x+N]=d;
	}
	if(i==n)
	cout<<"NO\n";
	else
	cout<<"YES\n";
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define  fast()      ios :: sync_with_stdio(false); cin.tie(0);
#define  ll             long long int
#define  ull            unsigned long long int
#define  ld             long double
#define  vi             vector<int>
#define vl              vector<long long>
#define vc              vector<char>
#define vs              vector<string>
#define vp              vector< pair<ll,ll> >
#define sl              set<long long>
#define sc              set<char>
#define sts             stack<string>
#define max_3(a,b,c)    max(a, max(b,c))
#define max_4(a,b,c,d)  max(a,max(b,max(c,d)))
#define min_3(a,b,c)    min(a, min(b,c))
#define min_4(a,b,c,d)  min(a,min(b,min(c,d)))
#define gcd(a,b)        __gcd(a,b)
#define lcm(a,b)        (a*b)/gcd(a,b)
#define pi              2*acos(0.0)
#define N               50000
ll s[2*N],y[N];
int main()
{
    fast()
    int i,n,x,d;
	cin>>n;
	for(i=0;i<n;i++)
	{
		cin>>x>>d;
		if(s[x+d]==-d)
		break;
		s[x]=d;
	}
	if(i==n)
	cout<<"NO\n";
	else
	cout<<"YES\n";
	return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);

	int n;
	cin >> n;
	int a[n][2];
	for (int i = 0; i < n; i++) {
		cin >> a[i][0] >> a[i][1];
	}
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < n; j++) {
			if (a[i][0] + a[i][1] == a[j][0] && a[j][0] + a[j][1] == a[i][0]) {
				cout << "YES" << "\n";
				return 0;
			}
		}
	}
	cout << "NO" << "\n";

	return 0;
}


#include <bits/stdc++.h>
using namespace std;

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);

	int n;
	cin >> n;
	int a[n][2];
	for (int i = 0; i < n; i++) {
		cin >> a[i][0] >> a[i][1];
	}
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < n; j++) {
			if (a[i][1] == a[j][0] && a[j][0] + a[j][1] == a[i][0]) {
				cout << "YES" << "\n";
				return 0;
			}
		}
	}
	cout << "NO" << "\n";

	return 0;
}


#include <iostream>
#include <map>
#include <iterator>
using namespace std;

int main()
{
    int n,pos,spit;
    cin>>n;
    string ans="NO";
    map<int,int>cont;
    while(n--)
    {
        cin>>pos>>spit;
        // cont.insert(make_pair(pos,spit));
        cont[pos]=spit;
    }

    for(map<int,int>::iterator itr=cont.begin(); itr!=cont.end(); itr++)
    {
        //  cout<<"itr->first= "<<itr->first<<"   itr->second= "<<itr->second<<endl;
        int secCamel=itr->first+itr->second;
        if (cont.count(secCamel) && secCamel+cont[secCamel]==itr->first)
        {
            ans="YES";
            break;
        }
    }
    cout<<ans<<endl;
    return 0;
}


#include <iostream>

using namespace std;
/*
bool doCamelExists(int cont[][2],int arr_size, int camelPos)
{
    for (int i=0; i<arr_size; i++)
    {
        if (cont[i][0]==camelPos)
            return true;
    }
    return false;
}
*/
int IndexOf(int cont[][2], int arr_size, int camel){
    for (int i=0; i<arr_size; i++)
    {
        if (cont[i][0]==camel)
            return i;
    }
    return -1;
}

int main()
{
    int n;
    cin>>n;
    string ans="NO";
    int cont[n][2];
    for(int i=0; i<n; i++)
        cin>>cont[i][0]>>cont[i][1];

    for(int i=0; i<n; i++)
    {
        int secCamel=cont[i][0]+cont[i][1];
        //bool camExt = doCamelExists(cont, n, secCamel);
        int secCamelIndex= IndexOf(cont, n, secCamel);
        if (secCamelIndex != -1 && cont[secCamelIndex][0]+cont[secCamelIndex][1]==cont[i][0])
        {
            ans="YES";
            break;
        }
    }
    cout<<ans<<endl;
}


//DFS
#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
vector<int> node[100003];
int vis[100003];
int dis[100003];
int mx;

int main()
{
ll n; cin>>n;
ll a[n],b[n],flag=0;
for(ll i=0;i<n;i++)
{
    cin>>a[i]>>b[i];
}
for(ll i=0;i<n-1;i++)
{

    if(b[i]+a[i]==a[i+1]&&b[i+1]+a[i+1]==a[i])
    {
        flag=1;
        break;
    }

}
if(flag) cout<<"YES"<<endl;
else
    cout<<"NO"<<endl;
}


//DFS
#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
vector<int> node[100003];
int vis[100003];
int dis[100003];
int mx;

int main()
{
ll n; cin>>n;
ll a[n],b[n],flag=0;
for(ll i=0;i<n;i++)
{
    cin>>a[i]>>b[i];
}
for(ll i=0;i<n;i++)
{

    if(b[i]+a[i]==a[i+1]&&b[i+1]+a[i+1]==a[i])
    {
        flag=1;
        break;
    }

}
if(flag) cout<<"YES"<<endl;
else
    cout<<"NO"<<endl;
}


//DFS
#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
vector<int> node[100003];
int vis[100003];
int dis[100003];
int mx;

int main()
{
ll n; cin>>n;
ll a[n],b[n],flag=0;
for(ll i=0;i<n;i++)
{
    cin>>a[i]>>b[i];
}
for(ll i=0;i<n-1;i++)
{
    if(b[i]==a[i+1]&&b[i+1]+a[i+1]==a[i])
    {
        flag=1;
        break;
    }
}
if(flag) cout<<"YES"<<endl;
else
    cout<<"NO"<<endl;
}


//DFS
#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
vector<int> node[100003];
int vis[100003];
int dis[100003];
int mx;

int main()
{
ll n; cin>>n;
ll a[n],b[n],flag=0;
for(ll i=0;i<n;i++)
{
    cin>>a[i]>>b[i];
}
for(ll i=0;i<n;i++)
{
   for(ll j=0;j<n;j++){
    if(b[i]+a[i]==a[j]&&b[j]+a[j]==a[i])
    {
        flag=1;
        break;
    }
   }
}
if(flag) cout<<"YES"<<endl;
else
    cout<<"NO"<<endl;
}


#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <iomanip>
#include <iterator>
#include <cstdio>
#include <vector>
#include <string>
#include <regex>
#include <numeric>
#include <cmath>
#include <algorithm>
#include <set>
#include <map>
#include <deque>
#include <queue>
#include <stack>
#include <utility>
#include <random>
#include <bitset>
#include <list>
#include <functional>
#include <chrono>
#include <fstream>
#include <array>
using namespace std;
template < class T, typename A = allocator<T> >
class Vector : public vector<T, A>
{
public:
	using vector<T, A>::vector;
	using typename vector<T, A>::size_type;
	using typename vector<T, A>::value_type;
	using typename vector<T, A>::allocator_type;
	Vector& operator()(size_type dummy_n, const value_type& val = value_type(), const allocator_type& alloc = allocator_type()) { return *this; }
};
template<> class Vector<string> : public vector<string> { public:using vector<string>::vector; Vector& operator()(size_type dummy_n) { return *this; } };
typedef long long ll;            typedef unsigned int u;
typedef pair<int, int> pii;      typedef pair<u, u> puu;
typedef Vector<bool> vb;// Vector
typedef Vector<int> vi;          typedef Vector<u> vu;
typedef Vector<ll> vll;
typedef Vector<string> vs;
typedef Vector<pii> vpii;        typedef Vector<puu> vpuu;
typedef Vector<Vector<int>> vvi; typedef Vector<Vector<u>> vvu;
typedef set<int> si;             typedef set<u> su;
typedef multiset<int> Si;        typedef multiset<u> Su;
typedef map<int, int> mi;        typedef map<u, u> mu;
typedef multimap<int, int> Mi;   typedef multimap<u, u> Mu;
template < typename Int = int > // only integral types
inline Int read() // "([number][space or newline])*" // reads -int_max but doesn't read int_min
{
	int c{ getchar() };
	if (c == '-') {
		Int init{ getchar() & 15 };
		while ((c = getchar()) & 16) init = (init << 3) + (init << 1) + (c & 15);
		return ++(init = ~init);
	}
	else {
		Int init{ c & 15 };
		while ((c = getchar()) & 16) init = (init << 3) + (init << 1) + (c & 15);
		return init;
	}
}
inline void read(int& a) // "([number][space or newline])*" // reads -int_max but doesn't read int_min
{
	a = getchar() & 15;
	if (a == 13) {
		a = getchar() & 15;
		for (int c; (c = getchar()) & 16; a = (a << 3) + (a << 1) + (c & 15));
		++(a = ~a);
	}
	else
		for (int c; (c = getchar()) & 16; a = (a << 3) + (a << 1) + (c & 15));
}
inline void read(unsigned int& a) // "([number][space or newline])*"
{
	a = getchar() & 15;
	for (int c; (c = getchar()) & 16; a = (a << 3) + (a << 1) + (c & 15));
}
inline void read(char& a) { scanf("%c%*c", &a); } // "([char][delim])*"
inline void read(string& a) { static char BUF[1234560]; scanf("%s%*c", BUF); a = move(string(BUF)); } // "([string][delim])*"
inline void read(ll& a) { a = read<ll>(); } // "([number][space or newline])*"
inline void read(double& a) { scanf("%lf%*c", &a); } // "([double][delim])*"
template < class T >
inline void read(pair<T, T>& a) { read(a.first); read(a.second); } // "([first][space or newline][second][space or newline])*"
template<template<typename T, typename A = allocator<T> > class C, class T>
inline void read(C<T>& a) { for (auto i = a.begin(); i != a.end(); ++i) read(*i); }
template < typename T, typename U, typename... ARGS >
inline void read(T& t, U& u, ARGS&... args) {
	read(t);
	read(u, args...);
}
template < typename Int > // only integral types
inline void write(Int x)
{
	static char BUF[64] = {};
	char *pnt{ BUF + 64 };
	if (x < 0) {
		putchar('-');
		++(x = ~x);
	}
	do
		*--pnt = x % 10 | 48;
	while (x /= 10);
	printf("%s", pnt);
}
inline void write(unsigned int a)
{
	static char BUF[16] = {};
	char *pnt{ BUF + 16 };
	do
		*--pnt = a % 10 | 48;
	while (a /= 10);
	printf("%s", pnt);
}
inline void write(const char& a) { printf("%c", a); }
inline void write(const char* a) { printf("%s", a); }
inline void write(const string& a) { printf("%s", a.c_str()); }
inline void write(const double& a) { printf("%lf", a); }
template < class T >
inline void write(const pair<T, T>& a) { write(a.first); write(' '); write(a.second); }
template<template<typename T, typename A = allocator<T> > class C, class T>
inline void write(const C<T>& a) { if (a.size()) write(*a.begin()); for (auto i = ++a.begin(); i != a.end(); ++i) { write(' '); write(*i); } }
template < typename T, typename U, typename... ARGS >
inline void write(const T& t, const U& u, const ARGS&... args) {
	write(t);
	write(' ');
	write(u, args...);
}
template<template<typename T, typename A = allocator<T> > class C, class T>
inline void sort(C<T>& a) { sort(a.begin(), a.end()); }
inline void sort(string& a) { sort(a.begin(), a.end()); }
template<template<typename T, typename A = allocator<T> > class C, class T>
inline void rsort(C<T>& a) { sort(a.rbegin(), a.rend()); }
inline void rsort(string& a) { sort(a.rbegin(), a.rend()); }
template < template < class T, class Compare = less<T>, class Alloc = allocator<T> > class C, class T>
inline bool in(const C<T>& c, const T& el) { return c.find(el) != c.end(); };
template < template < class Key, class T, class Compare = less<Key>, class Alloc = allocator<pair<const Key, T> > > class C, class Key, class T>
inline bool in(const C<Key, T>& c, const Key& el) { return c.find(el) != c.end(); };
template < template < class T, class Compare = less<T>, class Alloc = allocator<T> > class C, class T>
inline bool out(const C<T>& c, const T& el) { return c.find(el) == c.end(); };
template < template < class Key, class T, class Compare = less<Key>, class Alloc = allocator<pair<const Key, T> > > class C, class Key, class T>
inline bool out(const C<Key, T>& c, const Key& el) { return c.find(el) == c.end(); };
#define MX 1000000000
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define T(n) for(decltype(n) _VARIABLE{(n) + 1}; --_VARIABLE;)
#define F(b,e,i) for(auto i = decltype(e)(b); i != (e); decltype(e)(b) < (e) ? ++i : --i)
#define G(f,l,i) for(auto i = decltype(l)(f) + (decltype(l)(f) < (l) ? -1 : 1); (decltype(l)(f) < (l) ? i++ : i--) != (l) ;)
#define M(f,l,i,j) for(auto i = decltype(l)(f) , j = (l) ; i < j; ++i, --j)
#define R(type, ...) type __VA_ARGS__; read(__VA_ARGS__)
#define W(...) write(__VA_ARGS__), write('\n')
#define bgn begin()
#define rbgn rbegin()
#define nd end()
#define rnd rend()
#define pb push_back
#define fnt front()
#define bck back()
#define sz size()
#define x first
#define y second

int main()
{
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#endif
	R(u, n);
	u shift = 10000, R{ shift << 1 | 1 };
	vector<su> a(R);
	T(n) {
		R(int, x, d);
		x += shift;
		if (u p = x + d; p < R)
			a[p].insert(x);
	}
	for (u i{}; i < a.size(); ++i)
		for (auto x : a[i])
			if (in(a[x], i)) {
				W("YES");
				return 0;
			}
	W("NO");
}
//
// ArtemParkhomets
//


#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <iomanip>
#include <iterator>
#include <cstdio>
#include <vector>
#include <string>
#include <regex>
#include <numeric>
#include <cmath>
#include <algorithm>
#include <set>
#include <map>
#include <deque>
#include <queue>
#include <stack>
#include <utility>
#include <random>
#include <bitset>
#include <list>
#include <functional>
#include <chrono>
#include <fstream>
#include <array>
using namespace std;
template < class T, typename A = allocator<T> >
class Vector : public vector<T, A>
{
public:
	using vector<T, A>::vector;
	using typename vector<T, A>::size_type;
	using typename vector<T, A>::value_type;
	using typename vector<T, A>::allocator_type;
	Vector& operator()(size_type dummy_n, const value_type& val = value_type(), const allocator_type& alloc = allocator_type()) { return *this; }
};
template<> class Vector<string> : public vector<string> { public:using vector<string>::vector; Vector& operator()(size_type dummy_n) { return *this; } };
typedef long long ll;            typedef unsigned int u;
typedef pair<int, int> pii;      typedef pair<u, u> puu;
typedef Vector<bool> vb;// Vector
typedef Vector<int> vi;          typedef Vector<u> vu;
typedef Vector<ll> vll;
typedef Vector<string> vs;
typedef Vector<pii> vpii;        typedef Vector<puu> vpuu;
typedef Vector<Vector<int>> vvi; typedef Vector<Vector<u>> vvu;
typedef set<int> si;             typedef set<u> su;
typedef multiset<int> Si;        typedef multiset<u> Su;
typedef map<int, int> mi;        typedef map<u, u> mu;
typedef multimap<int, int> Mi;   typedef multimap<u, u> Mu;
template < typename Int = int > // only integral types
inline Int read() // "([number][space or newline])*" // reads -int_max but doesn't read int_min
{
	int c{ getchar() };
	if (c == '-') {
		Int init{ getchar() & 15 };
		while ((c = getchar()) & 16) init = (init << 3) + (init << 1) + (c & 15);
		return ++(init = ~init);
	}
	else {
		Int init{ c & 15 };
		while ((c = getchar()) & 16) init = (init << 3) + (init << 1) + (c & 15);
		return init;
	}
}
inline void read(int& a) // "([number][space or newline])*" // reads -int_max but doesn't read int_min
{
	a = getchar() & 15;
	if (a == 13) {
		a = getchar() & 15;
		for (int c; (c = getchar()) & 16; a = (a << 3) + (a << 1) + (c & 15));
		++(a = ~a);
	}
	else
		for (int c; (c = getchar()) & 16; a = (a << 3) + (a << 1) + (c & 15));
}
inline void read(unsigned int& a) // "([number][space or newline])*"
{
	a = getchar() & 15;
	for (int c; (c = getchar()) & 16; a = (a << 3) + (a << 1) + (c & 15));
}
inline void read(char& a) { scanf("%c%*c", &a); } // "([char][delim])*"
inline void read(string& a) { static char BUF[1234560]; scanf("%s%*c", BUF); a = move(string(BUF)); } // "([string][delim])*"
inline void read(ll& a) { a = read<ll>(); } // "([number][space or newline])*"
inline void read(double& a) { scanf("%lf%*c", &a); } // "([double][delim])*"
template < class T >
inline void read(pair<T, T>& a) { read(a.first); read(a.second); } // "([first][space or newline][second][space or newline])*"
template<template<typename T, typename A = allocator<T> > class C, class T>
inline void read(C<T>& a) { for (auto i = a.begin(); i != a.end(); ++i) read(*i); }
template < typename T, typename U, typename... ARGS >
inline void read(T& t, U& u, ARGS&... args) {
	read(t);
	read(u, args...);
}
template < typename Int > // only integral types
inline void write(Int x)
{
	static char BUF[64] = {};
	char *pnt{ BUF + 64 };
	if (x < 0) {
		putchar('-');
		++(x = ~x);
	}
	do
		*--pnt = x % 10 | 48;
	while (x /= 10);
	printf("%s", pnt);
}
inline void write(unsigned int a)
{
	static char BUF[16] = {};
	char *pnt{ BUF + 16 };
	do
		*--pnt = a % 10 | 48;
	while (a /= 10);
	printf("%s", pnt);
}
inline void write(const char& a) { printf("%c", a); }
inline void write(const char* a) { printf("%s", a); }
inline void write(const string& a) { printf("%s", a.c_str()); }
inline void write(const double& a) { printf("%lf", a); }
template < class T >
inline void write(const pair<T, T>& a) { write(a.first); write(' '); write(a.second); }
template<template<typename T, typename A = allocator<T> > class C, class T>
inline void write(const C<T>& a) { if (a.size()) write(*a.begin()); for (auto i = ++a.begin(); i != a.end(); ++i) { write(' '); write(*i); } }
template < typename T, typename U, typename... ARGS >
inline void write(const T& t, const U& u, const ARGS&... args) {
	write(t);
	write(' ');
	write(u, args...);
}
template<template<typename T, typename A = allocator<T> > class C, class T>
inline void sort(C<T>& a) { sort(a.begin(), a.end()); }
inline void sort(string& a) { sort(a.begin(), a.end()); }
template<template<typename T, typename A = allocator<T> > class C, class T>
inline void rsort(C<T>& a) { sort(a.rbegin(), a.rend()); }
inline void rsort(string& a) { sort(a.rbegin(), a.rend()); }
template < template < class T, class Compare = less<T>, class Alloc = allocator<T> > class C, class T>
inline bool in(const C<T>& c, const T& el) { return c.find(el) != c.end(); };
template < template < class Key, class T, class Compare = less<Key>, class Alloc = allocator<pair<const Key, T> > > class C, class Key, class T>
inline bool in(const C<Key, T>& c, const Key& el) { return c.find(el) != c.end(); };
template < template < class T, class Compare = less<T>, class Alloc = allocator<T> > class C, class T>
inline bool out(const C<T>& c, const T& el) { return c.find(el) == c.end(); };
template < template < class Key, class T, class Compare = less<Key>, class Alloc = allocator<pair<const Key, T> > > class C, class Key, class T>
inline bool out(const C<Key, T>& c, const Key& el) { return c.find(el) == c.end(); };
#define MX 1000000000
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define T(n) for(decltype(n) _VARIABLE{(n) + 1}; --_VARIABLE;)
#define F(b,e,i) for(auto i = decltype(e)(b); i != (e); decltype(e)(b) < (e) ? ++i : --i)
#define G(f,l,i) for(auto i = decltype(l)(f) + (decltype(l)(f) < (l) ? -1 : 1); (decltype(l)(f) < (l) ? i++ : i--) != (l) ;)
#define M(f,l,i,j) for(auto i = decltype(l)(f) , j = (l) ; i < j; ++i, --j)
#define R(type, ...) type __VA_ARGS__; read(__VA_ARGS__)
#define W(...) write(__VA_ARGS__), write('\n')
#define bgn begin()
#define rbgn rbegin()
#define nd end()
#define rnd rend()
#define pb push_back
#define fnt front()
#define bck back()
#define sz size()
#define x first
#define y second

int main()
{
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#endif
	R(u, n);
	u shift = 10000, R{ shift << 1 | 1 };
	vector<su> a(R);
	T(n) {
		R(int, x, d);
		x += shift;
		if (u p = x + d; p < R)
			a[p].insert(x);
	}
	F(0, a.size(), i)
		for (auto x : a[i])
			if (in(a[x], i)) {
				W("YES");
				return 0;
			}
	W("NO");
}
//
// ArtemParkhomets
//


#include<bits/stdc++.h>

using namespace std;

#define ll long long
#define pb push_back
#define sc second
#define fr first
#define mk make_pair

ll n, k, x[105], d[105], pos[1000005];

int main() {

    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    cin >> n;

    for(int i = 1; i <= n; ++i){
        cin >> x[i] >> d[i];
        pos[x[i]] = i;
    }
    for(int i = 1; i <= n; ++i){
        if(x[pos[x[i] + d[i]]] + d[pos[x[i] + d[i]]] == x[i]) {cout << "YES"; return 0;}
    }
    cout << "NO";
    return 0;

}


#include<bits/stdc++.h>

using namespace std;

#define ll long long
#define pb push_back
#define sc second
#define fr first
#define mk make_pair

ll n, k, x[105], d[105];
map<int, int> pos;

int main() {

    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    cin >> n;

    for(int i = 1; i <= n; ++i){
        cin >> x[i] >> d[i];
        pos[x[i]] = i;
    }
    for(int i = 1; i <= n; ++i){
        if(x[pos[x[i] + d[i]]] + d[pos[x[i] + d[i]]] == x[i]) {cout << "YES"; return 0;}
    }
    cout << "NO";
    return 0;

}


#include<iostream>
#include<unordered_map>
#include<vector>
using namespace std;
int main(){
	int n;
	cin >> n;
	unordered_map<long int,vector<long int>> mmap;
	for(int i = 0; i < n; i++){
		long int x,d;
		cin >> x >> d;
		mmap[x].push_back(d);
	}
	unordered_map<long int,vector<long int>> :: iterator it;
	bool flag = false;
	for(it = mmap.begin(); it != mmap.end(); it++){
		if(it->second[0] != 0){
			long int dest = it->first + it->second[0];
			// cout << it->first << endl;
			if(mmap[dest].size() > 0){
				long int src = mmap[dest][0] + dest;
				if(src == it->first){
					flag = true;
					break;
				}
			}
		}
	}
	if(flag)
		cout << "YES" << endl;
	else
		cout << "NO" << endl;
	return 0;
}


#include<iostream>
#include<unordered_map>
#include<vector>
using namespace std;
int main(){
	int n;
	cin >> n;
	unordered_map<long int,vector<long int>> mmap;
	unordered_map<long int,long int> cmap;
	for(int i = 0; i < n; i++){
		long int x,d;
		cin >> x >> d;
		cmap[x]++;
		mmap[x].push_back(d);
	}
	unordered_map<long int,vector<long int>> :: iterator it;
	bool flag = false;
	for(it = mmap.begin(); it != mmap.end(); it++){
		if(it->second[0] != 0){
			long int dest = it->first + it->second[0];
			// cout << dest << endl;
			// cout << dest << " " << mmap[dest].size() << endl;
			if(cmap[dest] > 0 ){
				long int src = mmap[dest][0] + dest;
				if(src == it->first){
					flag = true;
					break;
				}
			}
		}
	}
	if(flag)
		cout << "YES" << endl;
	else
		cout << "NO" << endl;
	return 0;
}


#include<iostream>
#include<unordered_map>
#include<vector>
using namespace std;
int main(){
	int n;
	cin >> n;
	unordered_map<long int,vector<long int>> mmap;
	for(int i = 0; i < n; i++){
		long int x,d;
		cin >> x >> d;
		mmap[x].push_back(d);
	}
	unordered_map<long int,vector<long int>> :: iterator it;
	bool flag = false;
	for(it = mmap.begin(); it != mmap.end(); it++){
		long int dest = it->first + it->second[0];
		if(mmap[dest].size() > 0){
			long int src = mmap[dest][0] + dest;
			if(src == it->first){
				flag = true;
				break;
			}
		}
	}
	if(flag)
		cout << "YES" << endl;
	else
		cout << "NO" << endl;
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main(){
    int N;
    unordered_map<int, int> pos;
    cin >> N;
    for(int i = 0; i < N; i++){
        int a, b;
        cin >> a >> b;
        pos.insert(make_pair(a, b));
    }
    for(pair<int, int> i : pos){
        int go = i.first + i.second;
        if(pos.find(go) != pos.end() && pos[go] == -i.second){
            cout << "YES" << endl;
            return 0;
        }
    }
    cout << "NO" << endl;
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main(){
    int N;
    unordered_map<int, int> pos;
    cin >> N;
    for(int i = 0; i < N; i++){
        int a, b;
        cin >> a >> b;
        pos.insert(make_pair(a, b));
    }
    for(pair<int, int> i : pos){
        int go = i.first + i.second;
        if(pos[go] == -i.second){
            cout << "YES" << endl;
            return 0;
        }
    }
    cout << "NO" << endl;
    return 0;
}


#include<bits/stdc++.h>

using namespace std;

#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define file() freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#define z cout<<"\n";

int main()
{
    optimize();
    int n,i=1;
    cin>>n;
    int x[n],d[n];
    for(int i=0;i<n;i++)
    {
        cin>>x[i]>>d[i];
    }
    int c=0;
    for(int i=0;i<n;i++)
    {
        for(int j=i+1;j<n;j++)
        {
            if((abs(x[i]-x[j])==d[i])&&(d[i]!=d[j])&&(d[i]==abs(d[j])))
            {
                c++;
                cout<<"YES";
                z;
                return 0;
            }
        }
    }
    if(c==0)
    {
        cout<<"NO";
        z;
    }

    return 0;

}


#include<bits/stdc++.h>

using namespace std;

#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define file() freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#define z cout<<"\n";

int main()
{
    optimize();
    int n,i=1;
    cin>>n;
    int x[n],d[n];
    for(int i=0;i<n;i++)
    {
        cin>>x[i]>>d[i];
    }
    int c=0;
    for(int i=0;i<n;i++)
    {
        for(int j=i+1;j<n;j++)
        {
            if((x[i]+d[i]==x[j]&&x[j]+d[j]==x[i]))
            {
                c++;
                cout<<"YES";
                z;
                return 0;
            }
        }
    }
    if(c==0)
    {
        cout<<"NO";
        z;
    }

    return 0;

}


#include<bits/stdc++.h>

#define fr first
#define se second
#define ll long long
#define pb push_back

using namespace std;

const long long N = 1e3+7;
const long long mod = 1e3 + 7;
ll n;
ll m;
ll cnt;
ll mx;
ll a;
ll x;
ll y;
ll used[2*5000];
pair<int,int>p;
int main(){
cin >> n ;
for( int i=0; i < n;i ++ ){
    cin >> x >> y;
        if( used[x+y+mod]==-y ){
            a=1;
            break;
        }
    used[x+mod]=y;
}
if( a )
    cout<<"YES";
else
    cout<<"NO";
 }


#include<bits/stdc++.h>

#define fr first
#define se second
#define ll long long
#define pb push_back

using namespace std;

const long long N = 1e3+7;
const long long mod = 1e3 + 7;
const long long M=50000;
ll n;
ll a;
ll x;
ll y;
ll used[2*M];
int main(){
cin >> n ;
for( int i=0; i < n;i ++ ){
    cin >> x >> y;
        if( used[x+y+M]==-y ){
            a=1;
            break;
        }
    used[x+M]=y;
}
if( a )
    cout<<"YES";
else
    cout<<"NO";
 }


#include<bits/stdc++.h>

#define fr first
#define se second
#define ll long long
#define pb push_back

using namespace std;

const long long N = 1e3+7;
const long long mod = 1e3 + 7;
ll n;
ll m;
ll cnt;
ll mx;
ll a;
ll x;
ll y;
ll used[2*50000];
pair<int,int>p;
int main(){
cin >> n ;
for( int i=0; i < n;i ++ ){
    cin >> x >> y;
        if( used[x+y+mod]==-y ){
            a=1;
            break;
        }
    used[x+mod]=y;
}
if( a )
    cout<<"YES";
else
    cout<<"NO";
 }


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<ll> vi;
#define mp make_pair
#define pb emplace_back
#define sq(x) ((x)*(x))
#define fo(i,n) for(int i=0;i<n;i++)
#define fp(i,k,n) for(int i=k;i<n;i++)
#define Fo(i,n) for(int i=1;i<=n;i++)
#define all(x) x.begin(),x.end()
#define uni(c) (c).resize(unique(all(c))-(c).begin())
#define fast ios_base::sync_with_stdio(0);cin.tie(NULL)
int main()
{
    fast;
    map<ll,ll> a;
    ll n,x,d;cin>>n;
    ll t=n;
    while(t--)
    {
        cin>>x>>d;
        a[x]=x+d;
    }
    for(auto it=a.begin();it!=a.end();it++)
    {
        if(a.count(it->second))
        if(a[it->second]==it->first)
        {
            cout<<"YES";
            return 0;
        }
    }
    cout<<"NO";
    return 0;
}


/// ///////////////////////  BISMILLAH   /////////////////////////////////

#include <cstring>
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>

using namespace std;
#define MAX 3001

int main ()
{
        ios_base::sync_with_stdio(false);
        long n,m,h,k,tot=0,low=100001;
          cin>> n>> m; long d[n+1];
          vector<long> c[100001],v[n+1],z;

             for(int i=1;i<=n;i++)
             {
                 cin>> k; z.push_back(k);
                 c[k].push_back(i); d[i]=k;
             }
                  while(m--)
                  {
                        cin>> h>> k;
                        v[h].push_back(k), v[k].push_back(h);
                  }
                      for(long j=0;j<z.size();j++)
                      {
                           long i=z[j];

                                 set<long> s;
                                 long e[n+1]; memset(e,0,sizeof(e));
                                 for(long l=0;l<c[i].size();l++)
                                 {
                                       h=c[i][l];
                                       if(!e[h])
                                       {
                                           for(k=0;k<v[h].size();k++)
                                             s.insert(d[v[h][k]]);
                                                 e[h]=true;
                                       }
                                 }

                                     if(find(s.begin(),s.end(),i)!=s.end())
                                          s.erase(i);

                                         if(s.size()>tot)
                                            tot=s.size(), low=i;
                                         else if(s.size()== tot && i<low)
                                            low=i;
                      }

                              cout<< low;

              return 0;
}


/// ///////////////////////  BISMILLAH   /////////////////////////////////

#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;
int main ()
{
              long n,m,h,k,tot=-1,low;
              cin>> n>> m;
            long d[n+1]; vector<long> z; vector<long>:: iterator it;

            for(int i=1;i<=n;i++)
                cin>> k, z.push_back(k) , d[i]=k;

                sort(z.begin(),z.end());
                it=unique(z.begin(),z.end());
                   z.resize(distance(z.begin(),it));
                vector<long> x[100001];
                low=*z.begin();

                   while(m--)
                   {
                        cin>> h>> k;
                        x[d[h]].push_back(d[k]),
                        x[d[k]].push_back(d[h]);
                   }
                        for(int i=0;i<z.size();i++)
                        {
                             h=false;
                             vector<long>& v= x[z[i]];
                             sort(v.begin(),v.end());
                             it= unique(v.begin(),v.end());
                             v.resize(distance(v.begin(),it));
                             if(find(v.begin(),v.end(),z[i])!=v.end())
                                h=true;
                             long f=v.size()-h;
                             if(f>tot) tot=f,low=z[i];
                        }

                            cout<< low;

              return 0;
}


/// ///////////////////////  BISMILLAH   /////////////////////////////////

#include <cstring>
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>

using namespace std;
#define MAX 3001

int main ()
{
        ios_base::sync_with_stdio(false);
        long n,m,h,k,tot=0,low=100001;
          cin>> n>> m; long d[n+1];
          vector<long> c[100001],v[n+1],z;
           vector<long>:: iterator it;

             for(int i=1;i<=n;i++)
             {
                 cin>> k; z.push_back(k);
                 c[k].push_back(i); d[i]=k;
             }

                  sort(z.begin(),z.end());
                  it=unique(z.begin(),z.end());
                   z.resize(distance(z.begin(),it));

                  while(m--)
                  {
                        cin>> h>> k;
                        v[h].push_back(k), v[k].push_back(h);
                  }
                      for(long j=0;j<z.size();j++)
                      {
                           long i=z[j];

                                 set<long> s;
                                 long e[n+1]; memset(e,0,sizeof(e));
                                 for(long l=0;l<c[i].size();l++)
                                 {
                                       h=c[i][l];
                                       if(!e[h])
                                       {
                                           for(k=0;k<v[h].size();k++)
                                             s.insert(d[v[h][k]]);
                                                 e[h]=true;
                                       }
                                 }

                                     if(find(s.begin(),s.end(),i)!=s.end())
                                          s.erase(i);

                                         if(s.size()>tot)
                                            tot=s.size(), low=i;
                                         else if(s.size()== tot && i<low)
                                            low=i;
                      }

                              cout<< low;

              return 0;
}


/// ///////////////////////  BISMILLAH   /////////////////////////////////

#include <cstring>
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>

using namespace std;
#define MAX 3001
#define pb push_back
#define sz size()

int main ()
{
        ios_base::sync_with_stdio(false);
        long n,m,h,k,tot=0,low=100001;
          cin>> n>> m; long d[n+1];
          vector<long> c[100001],v[n+1],z;

             for(int i=1;i<=n;i++)
             {
                 cin>> k; z.pb(k);
                 c[k].pb(i); d[i]=k;
             }
                  while(m--)
                  {
                        cin>> h>> k;
                        v[h].pb(k), v[k].pb(h);
                  }
                      for(long j=0;j<z.sz;j++)
                      {
                           long i=z[j];

                                 set<long> s;
                                 for(long l=0;l<c[i].sz;l++)
                                 {
                                       h=c[i][l];
                                       for(k=0;k<v[h].sz;k++)
                                          s.insert(d[v[h][k]]);
                                 }

                                     if(find(s.begin(),s.end(),i)!=s.end())
                                          s.erase(i);

                                         if(s.sz>tot)
                                            tot=s.sz, low=i;
                                         else if(s.sz== tot && i<low)
                                            low=i;
                      }

                              cout<< low;

              return 0;
}