#include <bits/stdc++.h>
using namespace std;
int n, i, x, l, r, c;
priority_queue<pair<int, int>> q;
int main() {
  for (cin >> n; i < n; i++)
    cin >> l >> r, q.push({-l, 0}), q.push({-r - 1, 1});
  for (; !q.empty();) {
    c += q.top().second ? -1 : 1;
    if (c > 2) return cout << "NO", 0;
    q.pop();
  }
  cout << "YES";
}
