#include <bits/stdc++.h>
using namespace std;
int n, m, k, v;
multiset<int> A, B;
int main() {
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &v);
    A.insert(v);
  }
  for (int i = 0; i < m; ++i) {
    scanf("%d", &v);
    B.insert(v);
  }
  while (!A.empty() && !B.empty()) {
    if (*--A.end() <= *--B.end()) {
      A.erase(--A.end());
      B.erase(--B.end());
    } else
      break;
  }
  if (A.empty())
    puts("NO");
  else if (B.empty())
    puts("YES");
  else
    puts("YES");
  return 0;
}
