#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  vector<pair<int, int> > ev;
  for (int i = 0; i < n; ++i) {
    int l, r;
    scanf("%d%d", &l, &r);
    ev.push_back({l, 0});
    ev.push_back({r, 1});
  }
  sort(ev.begin(), ev.end());
  int cnt = 0;
  for (auto v : ev) {
    if (v.second == 0) {
      if (++cnt > 2) break;
    } else {
      --cnt;
    }
  }
  if (cnt > 2)
    printf("NO");
  else
    printf("YES");
  return 0;
}
