#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> v;
  int n;
  cin >> n;
  while (n--) {
    int a, b;
    cin >> a >> b;
    v.push_back(a);
    v.push_back(b);
  }
  sort(v.begin(), v.end());
  for (int i = 0; i < v.size() / 2; i++) {
    for (int j = v.size() / 2; j < v.size(); j++) {
      if (v[i] == v[j]) {
        cout << "NO" << endl;
        return 0;
      }
    }
  }
  cout << "YES" << endl;
  return 0;
}
