#include <bits/stdc++.h>
using namespace std;
long long n, m, i, l, j, k, a[110000], b[110000], c[110000];
int main() {
  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);
  sort(b, b + m);
  reverse(a, a + n);
  reverse(b, b + m);
  for (i = 0; i < n; i++)
    if (a[i] > b[i]) {
      cout << "YES";
      return 0;
    }
  cout << "NO";
}
