#include <bits/stdc++.h>
using namespace std;
bool mycmp(const pair<int, int> &m, const pair<int, int> &n) {
  if (m.first == n.first) {
    return m.second < n.second;
  }
  return m.first < n.first;
}
int main() {
  int n, i, num;
  cin >> n;
  vector<pair<int, int> > v(2 * n);
  for (i = 0; i < 2 * n;) {
    cin >> num;
    v[i].first = num;
    v[i].second = 1;
    ++i;
    cin >> num;
    v[i].first = num;
    v[i].second = 2;
    ++i;
  }
  sort(v.begin(), v.end(), mycmp);
  int ctr = 0;
  for (i = 0; i < 2 * n; i++) {
    if (v[i].second == 1) {
      ctr++;
    } else
      ctr--;
    if (ctr > 2) {
      cout << "NO";
      break;
    }
  }
  if (i == 2 * n) {
    cout << "YES";
  }
  return 0;
}
