#include <bits/stdc++.h>
using namespace std;
map<int, int> mp1, mp2;
vector<int> vc;
int main() {
  int n, m, k, i;
  scanf("%d %d %d", &n, &m, &k);
  for (i = 1; i <= n; i++) {
    scanf("%d", &k);
    if (!mp1[k]) vc.push_back(k);
    mp1[k]++;
  }
  for (i = 1; i <= m; i++) {
    scanf("%d", &k);
    if (!mp2[k]) vc.push_back(k);
    mp2[k]++;
  }
  int sum = 0;
  sort(vc.begin(), vc.end());
  for (i = vc.size() - 1; i >= 0; i--) {
    sum -= mp1[vc[i]];
    sum += mp2[vc[i]];
    if (sum < 0) {
      printf("YES");
      return 0;
    }
  }
  printf("NO");
}
