#include <bits/stdc++.h>
struct node {
  int rank, cnt;
  node() {}
  node(int _rank, int _cnt) {
    rank = _rank;
    cnt = _cnt;
  }
  friend bool operator<(const node& b, const node& a) {
    return a.rank > b.rank;
  }
};
const int N = 100000 + 10;
const int M = N << 1;
int x[M], idx = 0;
int n, m, K;
int a[N], b[N];
int ta[M], tb[M];
inline int Id(int v) { return std::lower_bound(x, x + idx, v) - x; }
std::priority_queue<node> Q1, Q2;
int main() {
  scanf("%d%d%d", &n, &m, &K);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
    x[idx++] = a[i];
  }
  for (int i = 0; i < m; ++i) {
    scanf("%d", &b[i]);
    x[idx++] = b[i];
  }
  std::sort(x, x + idx);
  idx = std::unique(x, x + idx) - x;
  memset(ta, 0, sizeof ta);
  for (int i = 0; i < n; ++i) ++ta[Id(a[i])];
  memset(tb, 0, sizeof tb);
  for (int i = 0; i < m; ++i) ++tb[Id(b[i])];
  for (int i = 0; i < M; ++i) {
    if (ta[i] > 0) {
      Q1.push(node(i, ta[i]));
    }
    if (tb[i] > 0) {
      Q2.push(node(i, tb[i]));
    }
  }
  bool f = false;
  while (!Q1.empty() && !Q2.empty()) {
    node u1 = Q1.top();
    Q1.pop();
    node u2 = Q2.top();
    Q2.pop();
    if (u1.rank > u2.rank) {
      f = true;
      break;
    } else {
      int v = u1.cnt;
      u1.cnt -= u2.cnt;
      u2.cnt -= v;
      if (u1.cnt > 0) Q1.push(u1);
      if (u2.cnt > 0) Q2.push(u2);
    }
    if (Q2.empty() && !Q1.empty()) {
      f = true;
      break;
    }
  }
  if (f)
    puts("YES");
  else
    puts("NO");
  return 0;
}
