#include <bits/stdc++.h>
using namespace std;
class bear {
 public:
  void init() {
    ios::sync_with_stdio(false);
    int N, M, K;
    cin >> N >> M >> K;
    if (N > M) {
      cout << "YES" << endl;
      return;
    }
    vector<int> Alice(N), Bob(M);
    for (int i = 0; i < N; i += 1) cin >> Alice[i];
    for (int i = 0; i < M; i += 1) cin >> Bob[i];
    sort(Alice.rbegin(), Alice.rend());
    sort(Bob.rbegin(), Bob.rend());
    for (int i = 0; i < N; i += 1)
      if (Alice[i] > Bob[i]) {
        cout << "YES" << endl;
        return;
      }
    cout << "NO" << endl;
  }
};
int main() {
  bear obj;
  obj.init();
  return 0;
}
