#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1E5 + 5;
long long m, n, k, alice[MAXN], bob[MAXN];
bool cmp(int x, int y) { return x > y; }
int main() {
  cin >> n >> m >> k;
  for (int i = 0; i < n; i++) cin >> alice[i];
  for (int i = 0; i < m; i++) cin >> bob[i];
  if (n > m) {
    cout << "YES" << endl;
    return 0;
  }
  sort(alice, alice + n, cmp);
  sort(bob, bob + m, cmp);
  for (int i = 0; i < n; i++) {
    if (alice[i] > bob[i]) {
      cout << "YES" << endl;
      return 0;
    }
  }
  cout << "NO" << endl;
}
