#include <bits/stdc++.h>
using namespace std;
int a[100010];
int b[100010];
int main() {
  int n, m, k;
  scanf("%d %d %d", &n, &m, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= m; i++) scanf("%d", &b[i]);
  sort(a + 1, a + n + 1);
  sort(b + 1, b + m + 1);
  if (b[m] < a[n]) {
    printf("YES\n");
    return 0;
  }
  int i = m, j = n;
  int cnt = 0;
  for (; i >= 1 && j >= 1; i--, j--) {
    b[i] -= a[j];
    if (b[i] >= 0) cnt++;
  }
  if (cnt >= n)
    printf("NO\n");
  else
    printf("YES\n");
  return 0;
}
