#include <bits/stdc++.h>
using namespace std;
int n, m, k, x, p, r;
map<int, int> a;
int main() {
  cin >> n >> m >> k;
  for (int i = 0; i < n; i++) scanf("%d", &x), a[-x]++;
  for (int i = 0; i < m; i++) scanf("%d", &x), a[-x]--;
  for (auto i : a) p += i.second, r |= p > 0;
  if (r)
    cout << "YES";
  else
    cout << "NO";
}
