#include <bits/stdc++.h>
using namespace std;
void doRoutine() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
}
struct hap {
  int x, d;
  hap(int x = 0, int d = 0) : x(x), d(d) {}
};
bool cmp(hap a, hap b) {
  if (a.x != b.x) {
    return a.x < b.x;
  } else {
    return a.d > b.d;
  }
}
signed main() {
  int n;
  cin >> n;
  vector<hap> haps;
  for (int i = 0; i < n; ++i) {
    int a, b;
    cin >> a >> b;
    haps.push_back(hap(a, 1));
    haps.push_back(hap(b, -1));
  }
  sort(haps.begin(), haps.end(), cmp);
  int bal = 0;
  for (auto x : haps) {
    bal += x.d;
    if (bal > 2) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
  return 0;
}
