#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  vector<int> a(n), b(m);
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < m; i++) cin >> b[i];
  sort(a.begin(), a.end());
  sort(b.begin(), b.end());
  int p = 0, q = 0;
  vector<int> A, B;
  while (p < n && q < m) {
    if (a[p] == b[q]) {
      p++;
      q++;
    } else {
      if (a[p] > b[q]) {
        B.push_back(b[q]);
        q++;
      } else {
        A.push_back(a[p]);
        p++;
      }
    }
  }
  while (p < n) A.push_back(a[p++]);
  while (q < m) B.push_back(b[q++]);
  if (A.size() == 0 && B.size() > 0) {
    cout << "NO";
    return 0;
  } else if (A.size() > 0 && B.size() == 0) {
    cout << "YES";
    return 0;
  } else if (A.size() == 0 && B.size() == 0) {
    cout << "NO";
    return 0;
  } else {
    int i = 0, j = 0;
    while (i < A.size() && j < B.size()) {
      if (B[j] < A[i]) {
        while (B[j] < A[i]) {
          j++;
          if (j == B.size()) {
            cout << "YES";
            return 0;
          }
        }
      } else {
        i++;
        j++;
        if (i == A.size()) {
          cout << "NO";
          return 0;
        }
        if (j == B.size()) {
          cout << "YES";
          return 0;
        }
      }
    }
  }
}
