#include <bits/stdc++.h>
using namespace std;
long long ff[200];
signed main() {
  long long n, m, k;
  cin >> n >> m >> k;
  vector<long long> v(n), vi(m);
  for (long long i = 0; i < n; i++) cin >> v[i];
  for (long long i = 0; i < m; i++) cin >> vi[i];
  sort(v.begin(), v.end());
  sort(vi.begin(), vi.end());
  if (n > m)
    cout << "YES";
  else {
    long long first = 0;
    for (long long i = 0; i < n; i++)
      if (v[i] > vi[m - n + i]) first = 1;
    if (first == 1)
      cout << "YES";
    else {
      cout << "NO";
    }
  }
}
