#include using namespace std; typedef pair pii; typedef long long ll; typedef vector vi; #define pb push_back #define eb emplace_back #define mp make_pair #define fi first #define se second #define rep(i,n) rep2(i,0,n) #define rep2(i,m,n) for(int i=m;i<(n);i++) #define ALL(c) (c).begin(),(c).end() int n; int x[12], y[12]; bool f = 0; int main() { cin >> n; rep(i, n) cin >> x[i] >> y[i]; for (int i = -10; i <= 10; ++i) { bool p = 1, q = 1; rep(j, n) { if (x[j] != i) p = 0; if (y[j] != i) q = 0; } f |= p; f |= q; } puts(f ? "YES" : "NO"); return 0; }