#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > v;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x, y;
    cin >> x >> y;
    v.push_back(make_pair(x, 0));
    v.push_back(make_pair(y, 1));
  }
  sort(v.begin(), v.end());
  int cnt = 0;
  bool flag = true;
  int pending = 0;
  for (int i = 0; i < 2 * n; i++) {
    if (v[i].second == 0) {
      cnt++;
      if (cnt > 2) flag = false;
    } else {
      cnt--;
    }
  }
  if (flag)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
