#include <bits/stdc++.h>
using namespace std;
int A[100010];
int B[100010];
map<int, int> alice;
map<int, int> bob;
int main() {
  int N, M, K;
  cin >> N >> M >> K;
  for (int i = 0; i < (N); ++i)
    scanf("%d", A + i), alice[A[i]]++, bob[A[i]] = bob[A[i]];
  for (int j = 0; j < (M); ++j)
    scanf("%d", B + j), bob[B[j]]++, alice[B[j]] = alice[B[j]];
  assert(alice.size() == bob.size());
  vector<int> C(alice.size());
  int i = 0;
  for (map<int, int>::iterator it = alice.begin(); it != alice.end();
       it++, i++) {
    C[i] = alice[it->first] - bob[it->first];
  }
  long long sum = 0;
  N = C.size();
  bool win = false;
  for (int i = (N - 1); i >= (0); --i) {
    sum += C[i];
    if (sum > 0) win = true;
  }
  if (win)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
