#include <bits/stdc++.h>
using namespace std;
const int maxn = 100010;
const int maxm = 45;
const int INF = 1LL << 61;
const long long mod = 1000000007;
int n, m;
int a[maxn];
int b[maxn];
int main() {
  int i, j;
  int k;
  scanf("%d%d%d", &n, &m, &k);
  for (i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  sort(a + 1, a + n + 1);
  for (i = 1; i <= m; i++) {
    scanf("%d", &b[i]);
  }
  sort(b + 1, b + m + 1);
  int x = 1;
  int y = 1;
  while (x <= n && y <= m) {
    if (a[x] <= b[y]) x++;
    y++;
  }
  if (x > n)
    printf("NO\n");
  else
    printf("YES\n");
  return 0;
}
