#include <bits/stdc++.h>
using namespace std;
const int maxn = 100000 + 5;
int a[maxn], b[maxn];
int main() {
  int n, m, k;
  while (scanf("%d%d%d", &n, &m, &k) != EOF) {
    for (int i = 0; i < n; i++) scanf("%d", &a[i]);
    for (int j = 0; j < m; j++) scanf("%d", &b[j]);
    sort(a, a + n);
    reverse(a, a + n);
    sort(b, b + m);
    reverse(b, b + m);
    int ans = 0;
    if (m < n) ans = 1;
    for (int i = 0; i < min(m, n); i++) {
      if (a[i] > b[i]) {
        ans = 1;
        break;
      }
    }
    if (ans == 1)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
