#include <bits/stdc++.h>
using namespace std;
int n, dem = 0;
vector<pair<int, int> > a;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    int x, y;
    cin >> x >> y;
    a.push_back(make_pair(x, 1));
    a.push_back(make_pair(y + 1, -1));
  }
  sort(a.begin(), a.end());
  for (int i = 0; i < a.size(); i++) {
    dem += a[i].second;
    if (dem > 2) return cout << "NO", 0;
  }
  cout << "YES";
  return 0;
}
