#include<bits/stdc++.h>
using ll= long long;
#define REP(i,n) for(ll i=0;i<ll(n);i++)
#define FOR(i,a,b) for(ll i=a;i<=ll(b);i++)
#define ALL(x) x.begin(),x.end()

#define INF (int)1e9 //10^9:∞
#define LLINF (long long)1e12
#define MOD (int)1e9+7 //10^9+7:合同式の法
#define PI 3.141592653589
#define PB push_back
#define fi first
#define se second

#define YESNO(T) if(T){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;}
#define yesno(T) if(T){cout<<"yes"<<endl;}else{cout<<"no"<<endl;}
#define YesNo(T) if(T){cout<<"Yes"<<endl;}else{cout<<"No"<<endl;}

#define Graph vector<vector<int>>
#define PII pair<int,int>
#define PLL pair<ll,ll>
#define VI vector<int>
#define VVI vector<vector<int>>
#define VPII vector<pair<int,int>>
#define VPLL vector<pair<ll,ll>>

#define DDD fixed<<setprecision(10)

using namespace std;
/*.....................USUFUL FUNCTIONS ......................*/
ll cmin(ll a,ll b){
    if(a<b) return a;
    else return b;
}
ll cmax(ll a,ll b){
    if(a>b) return a;
    else return b;
}

/*..................DEFINE GLOBAL VARIABLES...................*/


/*.....................DEFINE FUNCTIONS ......................*/


/*.........................kemkemG0...........................*/
int main() {
    
	int N;
	
	int A[1010],B[1010];
	cin>>N;
	PII V[1010];
	PII W[1010];
	
	REP(i,N){
	    cin>>A[i]>>B[i];
	    V[i]=PII(A[i],i);
	    W[i]=PII(B[i],i);
	}
	sort(V,V+N);
	sort(W,W+N);
	
	if(V[0].second!=W[0].second){
	    cout<<max(V[0].first,W[0].first);
	}else{
	    int a=V[0].first+W[0].first;
	    int b=max(V[0].first,W[1].first);
	    int c=max(V[1].first,W[0].first);
	    cout<<min(a,min(b,c));
	}
	
	
	
}


#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define For(x,y) for(int x = 0; x < y; x++)


int a[3];


int main(){
    ios::sync_with_stdio(0), cin.tie(0);
    For(i, 3) cin >> a[i];
    sort(a,a+3);
    if(a[2] - a[1] == a[1] - a[0]) cout << "Yes";
    else cout << "No";
}