#include <bits/stdc++.h>
using namespace std;
long long int mod = 1000000007;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int t, n;
  t = 1;
  while (t--) {
    cin >> n;
    int st[n], en[n];
    int ans = 1;
    int chReq = 1;
    for (int i = 0; i < n; i++) {
      cin >> st[i] >> en[i];
    }
    sort(st, st + n);
    sort(en, en + n);
    int i = 1, j = 0;
    while (i < n && j < n) {
      if (st[i] <= en[j]) {
        i++;
        chReq++;
      } else {
        chReq--;
        j++;
      }
      ans = max(ans, chReq);
    }
    if (ans <= 2) {
      cout << "YES";
    } else {
      cout << "NO";
    }
  }
  return 0;
}
