#include <bits/stdc++.h>
using namespace std;
struct event {
  int time;
  bool start;
};
bool by_time(struct event a, struct event b) {
  if (a.time == b.time) {
    return a.start > b.start;
  }
  return a.time < b.time;
}
int main(void) {
  int n;
  cin >> n;
  struct event in;
  vector<struct event> shows;
  for (int i = 0; i < n; i++) {
    cin >> in.time;
    in.start = true;
    shows.push_back(in);
    cin >> in.time;
    in.start = false;
    shows.push_back(in);
  }
  sort(shows.begin(), shows.end(), by_time);
  int current = 0;
  for (int i = 0; i < shows.size(); i++) {
    if (shows[i].start) {
      current++;
    } else {
      current--;
    }
    if (current > 2) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
}
