#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  vector<pair<int, int> > v;
  int x, y;
  for (int i = 0; i < n; i++) {
    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 = false;
  for (int i = 0; i < v.size(); i++) {
    if (v[i].second == 0) {
      cnt += 1;
    } else if (v[i].second == 1)
      cnt -= 1;
    if (cnt > 2) {
      flag = true;
      break;
    }
  }
  if (flag)
    cout << "NO\n";
  else
    cout << "YES\n";
  return 0;
}
