#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int n, m, k;
int a[N], b[N], c[N * 2] = {0};
int dis[N * 2], ndis = 0;
int main() {
  scanf("%d %d %d", &n, &m, &k);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    dis[ndis++] = a[i];
  }
  for (int i = 0; i < m; i++) {
    scanf("%d", &b[i]);
    dis[ndis++] = b[i];
  }
  sort(dis, dis + ndis);
  ndis = unique(dis, dis + ndis) - dis;
  for (int i = 0; i < n; i++) {
    c[lower_bound(dis, dis + ndis, a[i]) - dis]++;
  }
  for (int i = 0; i < m; i++) {
    c[lower_bound(dis, dis + ndis, b[i]) - dis]--;
  }
  bool have = 0;
  for (int i = ndis - 1; i >= 0; i--) {
    c[i] += c[i + 1];
    if (c[i] > 0) {
      have = 1;
    }
  }
  printf("%s\n", have ? "YES" : "NO");
}
