#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  map<int, int> visited;
  for (int i = 0; i < n; i++) {
    int l, r;
    cin >> l >> r;
    visited[l]++;
    visited[r + 1]--;
  }
  long long sum = 0;
  for (auto p : visited) {
    if (sum > 2) {
      cout << "NO\n";
      return 0;
    }
    sum += (p.second);
  }
  cout << "YES\n";
}
