#include <bits/stdc++.h>
using namespace std;
const int N = 100100;
int n;
vector<pair<int, int>> a;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    int x, y;
    scanf("%d%d", &x, &y);
    a.emplace_back(x, 1);
    a.emplace_back(y + 1, -1);
  }
  sort(a.begin(), a.end());
  int k = 0;
  for (auto p : a) {
    k += p.second;
    if (k > 2) {
      puts("NO");
      return 0;
    }
  }
  puts("YES");
  return 0;
}
