#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, t, j, tmp, n, m, k, cnt, fl, ind, c1, c2;
  cin >> n >> m >> k;
  vector<vector<int> > ar(2);
  ar[0].resize(n);
  ar[1].resize(m);
  for (i = 0; i < n; i++) {
    scanf("%d", &ar[0][i]);
  }
  for (i = 0; i < m; i++) {
    scanf("%d", &ar[1][i]);
  }
  sort(ar[0].begin(), ar[0].end());
  sort(ar[1].begin(), ar[1].end());
  ar[0].push_back(INT_MAX);
  ar[1].push_back(INT_MAX);
  fl = 1;
  i = j = c1 = c2 = 0;
  while (i < n or j < m) {
    if (ar[0][i] <= ar[1][j]) {
      if (fl == 1) {
        c1 = c2 = 0;
        fl = 0;
      }
      c1++;
      i++;
    } else {
      c2++;
      fl = 1;
      j++;
    }
    if (n - i > m - j) {
      printf("YES\n");
      return 0;
    }
  }
  printf("NO\n");
}
