#include <bits/stdc++.h>
using namespace std;
map<int, int> ma;
map<int, int>::iterator it;
int main() {
  int n, m, k, x, num;
  while (~scanf("%d%d%d", &n, &m, &k)) {
    ma.clear();
    for (int i = 1; i <= n; i++) {
      scanf("%d", &x);
      ma[x]++;
    }
    for (int i = 1; i <= m; i++) {
      scanf("%d", &x);
      ma[x]--;
    }
    num = 0;
    for (it = ma.begin(); it != ma.end(); it++) {
      num += it->second;
      if (num < 0) num = 0;
    }
    if (num > 0)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
