#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
int n, m, k;
vector<int> v1;
vector<int> v2;
int main() {
  while (~scanf("%d%d%d", &n, &m, &k)) {
    int x;
    for (int i = 0; i < n; ++i) {
      scanf("%d", &x);
      v1.push_back(x);
    }
    for (int i = 0; i < m; ++i) {
      scanf("%d", &x);
      v2.push_back(x);
    }
    sort(v1.begin(), v1.end());
    sort(v2.begin(), v2.end());
    int i = n - 1, j = m - 1;
    bool flag = false;
    int sum = 0;
    while (1) {
      if (i < 0) break;
      if (v2[j] == v1[i]) {
        i--;
        j--;
      } else if (j >= 0 && v2[j] > v1[i]) {
        sum++;
        j--;
      } else {
        if (sum == 0) {
          flag = true;
          break;
        } else {
          sum--;
          i--;
        }
      }
    }
    if (flag)
      puts("YES");
    else
      puts("NO");
  }
  return 0;
}
