#include <bits/stdc++.h>
using namespace std;
int a[100001];
int b[100001];
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= m; i++) cin >> b[i];
  sort(a + 1, a + n + 1);
  sort(b + 1, b + m + 1);
  reverse(a + 1, a + n + 1);
  reverse(b + 1, b + m + 1);
  for (int i = 1; i <= n; i++) {
    if (a[i] > b[i]) {
      cout << "YES";
      return 0;
    }
  }
  cout << "NO";
  return 0;
}
