#include <bits/stdc++.h>
using namespace std;
int n, m, k;
int a[100005], b[100005];
bool cmp(int x, int y) { return x > y; }
int main() {
  while (scanf("%d%d%d", &n, &m, &k) != EOF) {
    for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
    for (int j = 1; j <= m; j++) scanf("%d", &b[j]);
    sort(a + 1, a + 1 + n, cmp);
    sort(b + 1, b + 1 + m, cmp);
    int qa = 1, qb = 1;
    int num1 = 0, num2 = 0;
    int cur1, cur2;
    int flag = 0;
    while (qa <= n) {
      num1++;
      cur1 = a[qa];
      while (qa < n && (a[qa] == a[qa + 1])) {
        qa++;
        num1++;
      }
      while (qb <= m && b[qb] >= cur1) {
        num2++;
        qb++;
      }
      if (num1 > num2) {
        flag = 1;
        break;
      }
      qa++;
    }
    if (flag)
      puts("YES");
    else
      puts("NO");
  }
  return 0;
}
