#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 22;
int n1, n2, k, res;
int v1[MAXN], v2[MAXN];
int main() {
  ios::sync_with_stdio(false), cin.tie(0);
  cin >> n1 >> n2 >> k;
  for (int i = 1, x; i <= n1; i++) cin >> v1[i];
  for (int i = 1, x; i <= n2; i++) cin >> v2[i];
  sort(v1 + 1, v1 + n1 + 1);
  sort(v2 + 1, v2 + n2 + 1);
  for (int i = n1, j = n2; i >= 0 and j >= 0;) {
    if (v1[i] > v2[j])
      res++, i--;
    else if (v1[i] < v2[j])
      res--, j--;
    else
      i--, j--;
    if (res >= 1) {
      cout << "YES";
      return 0;
    }
  }
  cout << "NO";
  return 0;
}
