#include <bits/stdc++.h>

using namespace std;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	int n;
	cin >> n;
	vector<array<int, 2>> a(n);
	int res = INT_MAX;
	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(i == j) {
				res = min(res, a[i][0]+a[j][1]);
			} else {
				res = min(res, max(a[i][0], a[j][1]));
			}
		}
	}
	cout << res << '\n';
	return 0;
}

#include<bits/stdc++.h>

using namespace std;
using ll = long long;
using pint = pair<int,int>;
using p = complex<double>;

void f(vector<p>& B) {
	int N = B.size();
	double x = 0, y = 0;
	for(auto u : B)x += u.real(), y += u.imag();
	x /= N, y /= N;

	for(auto&u : B) {
		u = {u.real() - x, u.imag() - y};
	}
	sort(B.begin(), B.end(), [&](p a, p b){return (a.real() == b.real() ? a.imag() < b.imag() : a.real() < b.real()) ;});
}

void g(vector<p>& B, double b) {
	for(auto &i : B) {
		i *= p{cos(b), sin(b)};
	}
	sort(B.begin(), B.end(), [&](p a, p b){return (a.real() == b.real() ? a.imag() < b.imag() : a.real() < b.real()) ;});
}

int main()
{
	std::random_device seed_gen;
	std::default_random_engine engine(seed_gen());
	std::uniform_real_distribution<> dist(0.0, 2 * acos(-1));


	int N; cin >> N;
	vector<p> A(N), B(N);
	for(auto &u : A) {
		double a, b; cin >> a >> b;
		u = {a, b};
	}
	for(auto &u : B) {
		double a, b; cin >> a >> b;
		u = {a, b};
	}



	f(A);
	f(B);
	const double eps = 1e-2;
	for(int i = 0; i < 100000; i++) {
		g(B, dist(engine));

		bool ok = true;
		for(int i = 0; i < N; i++) {
			auto v = A[i] - B[i];
			if(abs(v) > eps) {
				ok = false;
			}
		}

		if(ok) {
			cout << "Yes" << endl;
			return 0;
		}
	}

	cout << "No" << endl;


}