#include <bits/stdc++.h>
using namespace std;
long long n, m, k;
long long x;
vector<long long> a, b;
long long res, res1;
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> m >> k;
  for (long long i = 0; i < n; i++) {
    cin >> x;
    a.push_back(x);
    res1 += x;
  }
  for (long long i = 0; i < m; i++) {
    cin >> x;
    b.push_back(x);
  }
  sort(a.begin(), a.end());
  sort(b.begin(), b.end());
  long long j = n - 1;
  for (long long i = m - 1; i >= 0; i--) {
    if (b[i] >= a[j])
      j--;
    else
      break;
    if (j < 0) break;
  }
  if (j >= 0)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
