#include <bits/stdc++.h>
using namespace std;
int a[100005];
int b[100005];
int n, m, k;
int main(void) {
  ios_base ::sync_with_stdio(0);
  cin >> n >> m >> k;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  for (int i = 1; i <= m; ++i) cin >> b[i];
  sort(a + 1, a + 1 + n);
  sort(b + 1, b + 1 + m);
  if (n > m) return cout << "YES\n", 0;
  while (n && m) {
    if (a[n] > b[m]) return cout << "YES\n", 0;
    --n;
    --m;
  }
  return cout << "NO\n", 0;
}
