#include <bits/stdc++.h>
using namespace std;
struct node {
  int st, en;
} TV[200010];
bool cmp(node a, node b) {
  if (a.st == b.st) {
    return a.en < b.en;
  }
  return a.st < b.st;
}
int main() {
  int n;
  int tv1, tv2;
  int flag;
  cin >> n;
  tv1 = -1;
  tv2 = -1;
  flag = 1;
  for (int i = 0; i < n; i++) {
    cin >> TV[i].st >> TV[i].en;
  }
  sort(TV, TV + n, cmp);
  for (int i = 0; i < n && flag; i++) {
    if (tv1 < TV[i].st) {
      tv1 = TV[i].en;
    } else {
      if (tv2 < TV[i].st) {
        tv2 = TV[i].en;
      } else {
        flag = 0;
      }
    }
  }
  if (flag) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
