#include <bits/stdc++.h>
using namespace std;
const int MAX = 100004;
int type[MAX];
void get(map<int, int> &m, vector<int> &ret) {
  ret.clear();
  for (map<int, int>::iterator it = m.begin(); it != m.end(); ++it) {
    while (it->second) {
      ret.push_back(it->first);
      it->second--;
    }
  }
}
int main() {
  int N, M, K, i, w;
  map<int, int> Alice, Bob;
  scanf("%d%d%d", &N, &M, &K);
  for (i = 0; i < N; ++i) {
    scanf("%d", type + i);
    Alice[type[i]]++;
  }
  for (i = 0; i < M; ++i) {
    scanf("%d", &w);
    Bob[w]++;
  }
  for (i = 0; i < N; ++i) {
    int move = min(Alice[type[i]], Bob[type[i]]);
    Alice[type[i]] -= move;
    Bob[type[i]] -= move;
  }
  vector<int> A, B;
  get(Alice, A), get(Bob, B);
  sort(A.begin(), A.end(), greater<int>());
  sort(B.begin(), B.end(), greater<int>());
  int n = min(A.size(), B.size());
  bool ret = false;
  for (int i = 0; i < n && !ret; ++i) {
    if (A[i] > B[i]) {
      ret = true;
    }
  }
  if (ret || A.size() > B.size()) {
    puts("YES");
  } else {
    puts("NO");
  }
  return 0;
}
