#include <bits/stdc++.h>
using namespace std;
const int N = 100000;
int n, m, k;
int alice[N], bob[N];
int main() {
  while (scanf("%d%d%d", &n, &m, &k) != EOF) {
    for (int i = 0; i < n; i++) {
      scanf("%d", &alice[i]);
    }
    for (int i = 0; i < m; i++) {
      scanf("%d", &bob[i]);
    }
    sort(alice, alice + n);
    sort(bob, bob + m);
    bool isOk = false;
    int comA = n - 1;
    int comB = m - 1;
    while (comA >= 0 && comB >= 0) {
      if (alice[comA] > bob[comB]) {
        break;
      }
      comA -= 1;
      comB -= 1;
    }
    if (comA >= 0) {
      isOk = true;
    }
    if (isOk) {
      printf("YES\n");
    } else {
      printf("NO\n");
    }
  }
  return 0;
}
