#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  long long int k;
  cin >> n >> m >> k;
  if (n > m) {
    long long int alice;
    long long int bob;
    for (int i = 0; i < n; i++) {
      cin >> alice;
    }
    for (int i = 0; i < m; i++) {
      cin >> bob;
    }
    cout << "YES" << endl;
  } else {
    int alice[200000];
    int bob[200000];
    for (int i = 0; i < n; i++) {
      cin >> alice[i];
    }
    for (int i = 0; i < m; i++) {
      cin >> bob[i];
    }
    sort(alice, alice + n);
    sort(bob, bob + m);
    int i = n - 1;
    int j = m - 1;
    int sbb = 0;
    while (i >= 0 && j >= 0) {
      if (alice[i] > bob[j]) {
        sbb = 1;
        break;
      }
      if (alice[i] < bob[j]) {
        i--;
        j--;
      } else if (alice[i] == bob[j]) {
        i--;
        j--;
      }
    }
    if (sbb == 1)
      cout << "YES" << endl;
    else if (sbb == 0)
      cout << "NO" << endl;
  }
  return 0;
}
