#include <bits/stdc++.h>
using namespace std;
int a[111111], b[111111], n, m, k;
int main() {
  while (scanf("%d%d%d", &n, &m, &k) != EOF) {
    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 + 1 + n);
    sort(b + 1, b + 1 + m);
    bool yes = 0;
    for (int i = 0; i <= max(n, m); i++) {
      if (n - i < 1 || m - i < 1) break;
      if (a[n - i] > b[m - i]) {
        yes = 1;
        printf("YES\n");
        break;
      }
    }
    if (yes) continue;
    if (n > m)
      printf("YES\n");
    else
      printf("NO\n");
  }
}
