#include <bits/stdc++.h>
using namespace std;
const int nmax = 2000010;
const int mod = 1000000007;
const long long inf = -1ll * 100000000000;
int n;
pair<int, int> ev[nmax];
bool cmp(pair<int, int> a, pair<int, int> b) {
  if (a.first != b.first) return a.first < b.first;
  return a.second > b.second;
}
int main() {
  ios::sync_with_stdio(0);
  cin >> n;
  int ptr = 0;
  for (int i = 0, l, r; i < n; i++) {
    cin >> l >> r;
    ev[ptr++] = make_pair(l, 1);
    ev[ptr++] = make_pair(r, -1);
  }
  sort(ev, ev + ptr, cmp);
  int ans = 0, mx = 0;
  for (int i = 0; i < ptr; i++) {
    ans += ev[i].second;
    mx = max(ans, mx);
  }
  cout << (mx <= 2 ? "YES" : "NO") << endl;
  return 0;
}
