#include <bits/stdc++.h>
using namespace std;
pair<int, bool> seg[2 * 200000];
int main(void) {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int l, r;
    scanf("%d%d", &l, &r);
    seg[i].first = l;
    seg[i].second = 1;
    seg[n + i].first = r + 1;
    seg[n + i].second = 0;
  }
  sort(seg, seg + 2 * n);
  int cur = 0;
  bool flag = true;
  for (int i = 0; i < 2 * n; i++) {
    if (seg[i].second)
      cur++;
    else if (cur)
      cur--;
    if (cur > 2) {
      flag = false;
      break;
    }
  }
  if (flag)
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
