#include <bits/stdc++.h>
using namespace std;
const double EPS = 1E-9;
const int INF = 1000000000;
const long long INF64 = (long long)1E18;
const double PI = 3.1415926535897932384626433832795;
bool cmp(long long a, long long b) { return a > b; }
int main() {
  long long i, j, n, k, m;
  long long *a = new long long[200000];
  long long *b = new long long[200000];
  cin >> n >> m >> k;
  for (i = 0; i < n; ++i) cin >> a[i];
  for (i = 0; i < m; ++i) cin >> b[i];
  sort(a, a + n, cmp);
  sort(b, b + m, cmp);
  bool bT = false;
  for (i = 0; i < m && i < n; ++i) {
    if (b[i] < a[i]) {
      bT = true;
      break;
    }
  }
  if (bT) {
    cout << "YES" << endl;
    return 0;
  }
  if (n > m) {
    cout << "YES" << endl;
    return 0;
  }
  cout << "NO" << endl;
  return 0;
}
