#include <bits/stdc++.h>
using namespace std;
long long int n;
vector<long long int> v;
map<long long int, long long int> mp, ck;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    long long int a, b;
    cin >> a >> b;
    ck[a]++;
    ck[b]++;
    ck[b + 1]++;
    mp[a]++;
    mp[b + 1]--;
    if (ck[a] == 1) v.push_back(a);
    if (ck[b] == 1) v.push_back(b);
    if (ck[b + 1] == 1) v.push_back(b + 1);
  }
  sort(v.begin(), v.end());
  long long int pre = 0;
  bool ans = true;
  for (int i = 0; i < v.size(); i++) {
    mp[v[i]] += pre;
    pre = mp[v[i]];
    if (pre > 2) ans = false;
  }
  cout << (ans ? "YES" : "NO") << endl;
  return 0;
}
