#include <bits/stdc++.h>
using namespace std;
const int OO = (int)1e9 + 7;
const int MAX = (int)1e4 + 1;
const int mod = (int)1e9 + 9;
int main(void) {
  int n, m, k;
  while (cin >> n >> m >> k) {
    vector<int> A(n);
    for (int i = 0; i < n; i++) cin >> A[i];
    vector<int> B(m);
    for (int i = 0; i < m; i++) cin >> B[i];
    if (n > m) {
      cout << "YES\n";
      continue;
    }
    sort(A.rbegin(), A.rend());
    sort(B.rbegin(), B.rend());
    int f = 0;
    for (int i = 0; i < n; i++)
      if (A[i] > B[i]) {
        f = 1;
        break;
      }
    cout << (f ? "YES" : "NO") << "\n";
  }
  return 0;
}
