#include <bits/stdc++.h>
using namespace std;
int n, m, k;
pair<int, int> p[400005];
int main() {
  cin >> n;
  int sz = 0;
  for (int i = 0; i < n; i++) {
    int a, b;
    cin >> a >> b;
    p[sz++] = make_pair(a, 0);
    p[sz++] = make_pair(b, 1);
  }
  int cnt = 0, last = -1, c = 0;
  sort(p, p + sz);
  for (int i = 0; i < sz; i++) {
    if (p[i].second == 0) {
      cnt++;
      last = p[i].first;
    } else
      cnt--;
    if (cnt > 2) {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES";
  return 0;
}
