#include <bits/stdc++.h>
using namespace std;
int n, m, k;
const int N = 100010;
int A[N];
int B[N];
bool judge() {
  while (n && m && B[m] >= A[n]) n--, m--;
  if (n && (!m || A[n] > B[m])) return true;
  return false;
}
int main() {
  while (cin >> n >> m >> k) {
    for (int i = 1; i <= n; i++) cin >> A[i];
    sort(A + 1, A + n + 1);
    for (int i = 1; i <= m; i++) cin >> B[i];
    sort(B + 1, B + m + 1);
    if (judge())
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}
