#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
int n;
int a[maxn], b[maxn], c[maxn * 6];
vector<int> v;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d%d", &a[i], &b[i]);
    for (int j = -1; j <= 1; ++j) {
      v.emplace_back(a[i] + j);
      v.emplace_back(b[i] + j);
    }
  }
  sort(v.begin(), v.end());
  v.erase(unique(v.begin(), v.end()), v.end());
  for (int i = 1; i <= n; ++i) {
    a[i] = lower_bound(v.begin(), v.end(), a[i]) - v.begin();
    b[i] = lower_bound(v.begin(), v.end(), b[i] + 1) - v.begin();
    ++c[a[i]];
    --c[b[i]];
  }
  for (int i = 0; i <= v.size(); ++i) {
    c[i] += c[i - 1];
    if (c[i] > 2) {
      printf("NO\n");
      return 0;
    }
  }
  printf("YES\n");
  return 0;
}
