#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long int n;
  cin >> n;
  pair<long long int, long long int> a[n];
  for (long long int i = 0; i < n; i++) cin >> a[i].first >> a[i].second;
  sort(a, a + n);
  long long int x1 = -1, y1 = -1, x2 = -1, y2 = -1;
  for (long long int i = 0; i < n; i++) {
    long long int x = a[i].first, y = a[i].second;
    if (x > y1) {
      x1 = x, y1 = y;
      continue;
    }
    if (x > y2) {
      x2 = x, y2 = y;
      continue;
    }
    return cout << "NO", 0;
  }
  cout << "YES";
}
