#include <bits/stdc++.h>
using namespace std;
int n;
map<int, int> a;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    int l, r;
    scanf("%d%d", &l, &r);
    a[l]++;
    a[r + 1]--;
  }
  int now = 0;
  for (auto i : a) {
    now += i.second;
    if (now > 2) {
      printf("NO");
      return 0;
    }
  }
  printf("YES");
  return 0;
}
