#include <bits/stdc++.h>
using namespace std;
long long int Pow(long long int B, long long int P) {
  long long int R = 1;
  while (P > 0) {
    if (P % 2 == 1) R = (R * B);
    P /= 2;
    B = (B * B);
  }
  return R;
}
int BigMod(long long int B, long long int P, long long int M) {
  long long int R = 1;
  while (P > 0) {
    if (P % 2 == 1) {
      R = (R * B) % M;
    }
    P /= 2;
    B = (B * B) % M;
  }
  return (int)R;
}
int prime[90000];
bool flag[100010];
int sieve() {
  int i, j, total = 0, val;
  val = sqrt(100010) + 1;
  flag[0] = flag[1] = 1;
  for (i = 2; i < val; i++)
    if (!flag[i])
      for (j = i; j * i <= 100010; j++) flag[i * j] = 1;
  for (i = 2; i <= 100010; i++)
    if (!flag[i]) prime[total++] = i;
  return total;
}
template <class T>
inline T lcm(T a, T b) {
  if (a < 0) return lcm(-a, b);
  if (b < 0) return lcm(a, -b);
  return a * (b / (gcd(a, b)));
}
template <class T>
inline T gcd(T a, T b) {
  if (a < 0) return gcd(-a, b);
  if (b < 0) return gcd(a, -b);
  return (b == 0) ? a : gcd(b, a % b);
}
int main() {
  int i, j, n, m, k, inp;
  vector<int> alice, bob;
  bool mark = false;
  cin >> n >> m >> k;
  for (i = 1; i <= n; i++) {
    cin >> inp;
    alice.push_back(inp);
  }
  for (i = 1; i <= m; i++) {
    cin >> inp;
    bob.push_back(inp);
  }
  alice.push_back(0);
  bob.push_back(0);
  sort(alice.begin(), alice.end());
  sort(bob.begin(), bob.end());
  int a = 0, b = 0;
  for (i = n, j = m; i >= 0 && j >= 0;) {
    if (alice[i] > bob[j]) {
      a++;
      i--;
    } else if (alice[i] < bob[j]) {
      b++;
      j--;
    } else {
      i--;
      j--;
    }
    if (a > b) {
      mark = true;
      break;
    }
  }
  if (mark || (m == 1 && alice[n - 1] > bob[m - 1]))
    cout << "YES\n";
  else
    cout << "NO\n";
  return 0;
}
