#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n;
  cin >> n;
  vector<pair<long long, long long> > arr;
  for (long long i = 0; i < n; i++) {
    long long a, b;
    cin >> a >> b;
    arr.push_back(make_pair(a, 1));
    arr.push_back(make_pair(b + 1, -1));
  }
  sort(arr.begin(), arr.end());
  long long cnt = 0;
  long long max_cnt = 0;
  if (arr[0].second == 1) {
    cnt++;
    max_cnt = max(cnt, max_cnt);
  }
  for (long long i = 1; i < arr.size(); i++) {
    if (arr[i].second == -1) {
      max_cnt = max(cnt, max_cnt);
      cnt--;
    }
    if (arr[i].second == 1) {
      cnt++;
      max_cnt = max(cnt, max_cnt);
    }
  }
  if (max_cnt > 2) {
    cout << "NO" << endl;
  } else {
    cout << "YES" << endl;
  }
}
int main() { solve(); }
