#include <bits/stdc++.h>
using namespace std;
const int N = 2000;
map<int, int> a;
int n, m, k;
int main() {
  scanf("%d %d %d", &n, &m, &k);
  a.clear();
  for (int i = 0; i != n; i++) {
    int v;
    scanf("%d", &v);
    ++a[v];
  }
  for (int i = 0; i != m; i++) {
    int v;
    scanf("%d", &v);
    --a[v];
  }
  int cnt = 0;
  bool flag = false;
  for (map<int, int>::iterator iter = a.end(); iter != a.begin();) {
    cnt += (--iter)->second;
    if (cnt > 0) {
      printf("YES\n");
      flag = true;
      break;
    }
  }
  if (!flag) printf("NO\n");
  return 0;
}
