#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, sum = 0;
  cin >> n;
  vector<int> a(2 * n);
  for (int i = 0; i < 2 * n; i++) cin >> a[i];
  sort(a.begin(), a.end());
  set<int> s;
  for (int i = 0; i < n; i++) s.insert(a[i]);
  string ans = "YES";
  for (int i = 2 * n - 1; i >= n; i--) {
    if (s.find(a[i]) != s.end()) {
      ans = "NO";
      break;
    }
  }
  cout << ans << endl;
  return 0;
}
