#include <bits/stdc++.h>
using namespace std;
int main() {
  int c, c2;
  map<int, int> mp;
  int n, m, k;
  scanf("%d%d%d", &n, &m, &k);
  for (c = 0; c < n; c++) {
    int v;
    scanf("%d", &v);
    mp[v]++;
  }
  for (c = 0; c < m; c++) {
    int v;
    scanf("%d", &v);
    mp[v]--;
  }
  vector<int> vals;
  for (map<int, int>::iterator it = mp.begin(); it != mp.end(); it++)
    vals.push_back(it->first);
  for (c = vals.size() - 1; c >= 0; c--) {
    if (mp[vals[c]] > 0) {
      printf("YES\n");
      return 0;
    }
    if (c == 0) break;
    mp[vals[c - 1]] += mp[vals[c]];
  }
  printf("NO\n");
  return 0;
}
