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