import java.util.Arrays;
import java.util.Scanner;

public class B {
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int a = s.nextInt(); int b = s.nextInt(); int k = s.nextInt();
		int[] al = new int[a]; int[] bo = new int[b];
		for(int i = 0; i < a; i++)
			al[i] = s.nextInt();
		for(int i = 0; i < b; i++)
			bo[i] = s.nextInt();
		if(a > b)
			System.out.println("YES");
		else {
			Arrays.sort(al); Arrays.sort(bo);
			boolean f = false; int i = 0; int j = 0;
			while(i < a && j < b) {
				while(i < a && al[i] < bo[j])
					i++;
				if(a-i > b-j) {
					f = true; break;
				}
				j++;
			}
			if(f) System.out.println("YES");
			else System.out.println("NO");

		}
	}

}


import java.util.Arrays;
import java.util.Scanner;

public class B {
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int a = s.nextInt(); int b = s.nextInt(); int k = s.nextInt();
		int[] al = new int[a]; int[] bo = new int[b];
		for(int i = 0; i < a; i++)
			al[i] = s.nextInt();
		for(int i = 0; i < b; i++)
			bo[i] = s.nextInt();
		if(a > b)
			System.out.println("YES");
		else {
			Arrays.sort(al); Arrays.sort(bo);
			/*for(int i = 0; i < a; i++)
				System.out.println(al[i]);
			System.out.println("grkeosgre");
			for(int i = 0; i < b; i++)
				System.out.println(bo[i]);*/
			boolean f = false; int i = 0; int j = 0;
			while(i < a && j < b) {
				while(j < b && al[i] > bo[j])
					j++;
				if(a-i > b-j) {
					f = true; break;
				}
				i++;
			}
			if(f) System.out.println("YES");
			else System.out.println("NO");

		}
	}

}


import java.util.Arrays;
import java.util.Scanner;

public class B {
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int a = s.nextInt(); int b = s.nextInt(); int k = s.nextInt();
		int[] al = new int[a]; int[] bo = new int[b];
		for(int i = 0; i < a; i++)
			al[i] = s.nextInt();
		for(int i = 0; i < b; i++)
			bo[i] = s.nextInt();
		if(a > b)
			System.out.println("YES");
		else {
			Arrays.sort(al); Arrays.sort(bo);
			boolean f = false; int i = a-1; int j = b-1;
			while(true) {
				while(i >= 0 && bo[i] > al[j])
					i--;
				if(al[j] == bo[i])
					j--;
				else if(al[j] > bo[i]) {
					f = true; break;
				}
				if(j < 0) break;
			}
			if(f) System.out.println("YES");
			else System.out.println("NO");

		}
	}

}


import java.util.Arrays;
import java.util.Scanner;

public class B {
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int a = s.nextInt(); int b = s.nextInt(); int k = s.nextInt();
		int[] al = new int[a]; int[] bo = new int[b];
		for(int i = 0; i < a; i++)
			al[i] = s.nextInt();
		for(int i = 0; i < b; i++)
			bo[i] = s.nextInt();
		if(a > b)
			System.out.println("YES");
		else {
			Arrays.sort(al); Arrays.sort(bo);
			for(int i = 0; i < a; i++)
				System.out.println(al[i]);
			System.out.println("grkeosgre");
			for(int i = 0; i < b; i++)
				System.out.println(bo[i]);
			boolean f = false; int i = 0; int j = 0;
			while(i < a && j < b) {
				while(i < a && al[i] <= bo[j])
					i++;
				if(a-i > b-j) {
					f = true; break;
				}
				j++;
			}
			if(f) System.out.println("YES");
			else System.out.println("NO");

		}
	}

}


import java.util.Arrays;
import java.util.Scanner;

public class B {
	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int a = s.nextInt(); int b = s.nextInt(); int k = s.nextInt();
		int[] al = new int[a]; int[] bo = new int[b];
		for(int i = 0; i < a; i++)
			al[i] = s.nextInt();
		for(int i = 0; i < b; i++)
			bo[i] = s.nextInt();
		if(a > b)
			System.out.println("YES");
		else {
			Arrays.sort(al); Arrays.sort(bo);
			/*for(int i = 0; i < a; i++)
				System.out.println(al[i]);
			System.out.println("grkeosgre");
			for(int i = 0; i < b; i++)
				System.out.println(bo[i]);*/
			boolean f = false; int i = 0; int j = 0;
			while(i < a && j < b) {
				while(i < a && al[i] > bo[j])
					j++;
				if(a-i > b-j) {
					f = true; break;
				}
				i++;
			}
			if(f) System.out.println("YES");
			else System.out.println("NO");

		}
	}

}


import java.io.*;
import java.util.*;
import java.math.*;

public class Main{

	public void solve(){
		int n, m, k;
		n = in.nextInt();
		m = in.nextInt();
		k = in.nextInt();
		HashMap<Integer, Integer> hash = new HashMap<>();
		for(int i = 0; i < n; i++){
			add(hash, in.nextInt(), 1);
		}
		for(int i = 0; i < m; i++){
			add(hash, in.nextInt(), -1);
		}

		List<Integer> a = new ArrayList<>();
		List<Integer> b = new ArrayList<>();
		for(int key: hash.keySet()){
			int num = hash.get(key);
			for(int i = 0; i < Math.abs(num); i++){
				if(num < 0) b.add(key);
				else a.add(key);
			}
		}

		Collections.sort(a);
		Collections.sort(b);

		if(b.size() < a.size()){
			out.println("YES");
			return;
		}

		for(int i = a.size() - 1, j = b.size() - 1; 0 <= i && 0 <= j; i--, j--){
			if(b.get(j) < a.get(i)){
				out.print("YES");
				return;
			}
		}
		out.print("NO");

	}

	public void add(HashMap<Integer, Integer> hash, int value, int num){
		Integer i = hash.get(value);
		if(i == null) i = 0;
		i += num;
		hash.put(value,  i);
	}

	MyInput in;
	PrintWriter out;

	public void run(){
		in = new MyInput(System.in);
		out = new PrintWriter(System.out);
		solve();
		out.close();
	}

	public static void main(String[] args){
		new Main().run();
	}
}

class MyInput{
	BufferedReader in;
	StringTokenizer token;

	MyInput(InputStream is){
		try{
			in = new BufferedReader(new InputStreamReader(is));
		}catch(Exception e){ e.printStackTrace(); }

	}

	String nextToken(){
		while(token == null || !token.hasMoreTokens()){
			try{
				token = new StringTokenizer(in.readLine());
			}catch(Exception e){ e.printStackTrace(); }
		}
		return token.nextToken();
	}

	int nextInt(){
		return Integer.parseInt(nextToken());
	}

	long nextLong(){
		return Long.parseLong(nextToken());
	}

	double nextDouble(){
		return Double.parseDouble(nextToken());
	}
}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class B {
	public static void main(String[] args) throws Exception {
		int n = nextInt();
		int m = nextInt();
		int k = nextInt();
		Integer[] alice = new Integer[n];
		for (int i = 0; i < n; i++) {
			alice[i] = nextInt();
		}
		Arrays.sort(alice);
		Integer[] bob = new Integer[m];
		for (int i = 0; i < m; i++) {
			bob[i] = nextInt();
		}
		Arrays.sort(bob);
		if (alice[n - 1] > bob[m - 1]||n>m) {
			System.out.println("YES");
		} else {
			if (n == m) {
				for (int i = 0; i < n; i++) {
					if (alice[i] > bob[i]) {
						System.out.println("YES");
						return;
					}
				}
			}
			System.out.println("NO");
		}
	}

	static BufferedReader br = new BufferedReader(new InputStreamReader(
			System.in));
	static StringTokenizer st = new StringTokenizer("");

	static int nextInt() throws Exception {
		return Integer.parseInt(next());
	}

	static String next() throws Exception {
		while (true) {
			if (st.hasMoreTokens()) {
				return st.nextToken();
			}
			String s = br.readLine();
			if (s == null) {
				return null;
			}
			st = new StringTokenizer(s);
		}
	}

}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class B {
	public static void main(String[] args) throws Exception {
		int n = nextInt();
		int m = nextInt();
		int k = nextInt();
		Integer[] alice = new Integer[n];
		for (int i = 0; i < n; i++) {
			alice[i] = nextInt();
		}
		Arrays.sort(alice);
		Integer[] bob = new Integer[m];
		for (int i = 0; i < m; i++) {
			bob[i] = nextInt();
		}
		Arrays.sort(bob);
		if (alice[n - 1] > bob[m - 1] || n > m) {
			System.out.println("YES");
		} else {
			if (n == m) {
				for (int i = 0; i < n; i++) {
					if (alice[i] > bob[i]) {
						System.out.println("YES");
						return;
					}
				}
			}
			int j = 0;
			for (int i = 0; j < m && i < n; i++) {
				if (alice[i] <= bob[j]) {
					i++;
					j++;
				} else if (alice[i] > bob[j]) {
					while (j < m && bob[j] < alice[i]) {
						j++;
					}
				}
			}
			if (j == m) {
				System.out.println("YES");
			} else
				System.out.println("NO");
		}
	}

	static BufferedReader br = new BufferedReader(new InputStreamReader(
			System.in));
	static StringTokenizer st = new StringTokenizer("");

	static int nextInt() throws Exception {
		return Integer.parseInt(next());
	}

	static String next() throws Exception {
		while (true) {
			if (st.hasMoreTokens()) {
				return st.nextToken();
			}
			String s = br.readLine();
			if (s == null) {
				return null;
			}
			st = new StringTokenizer(s);
		}
	}

}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class B {
	public static void main(String[] args) throws Exception {
		int n = nextInt();
		int m = nextInt();
		int k = nextInt();
		Integer[] alice = new Integer[n];
		for (int i = 0; i < n; i++) {
			alice[i] = nextInt();
		}
		Arrays.sort(alice);
		Integer[] bob = new Integer[m];
		for (int i = 0; i < m; i++) {
			bob[i] = nextInt();
		}
		Arrays.sort(bob);
		if (alice[n - 1] > bob[m - 1]) {
			System.out.println("YES");
		} else {
			if (n == m) {
				for (int i = 0; i < n; i++) {
					if (alice[i] > bob[i]) {
						System.out.println("YES");
						return;
					}
				}
			}
			System.out.println("NO");
		}
	}

	static BufferedReader br = new BufferedReader(new InputStreamReader(
			System.in));
	static StringTokenizer st = new StringTokenizer("");

	static int nextInt() throws Exception {
		return Integer.parseInt(next());
	}

	static String next() throws Exception {
		while (true) {
			if (st.hasMoreTokens()) {
				return st.nextToken();
			}
			String s = br.readLine();
			if (s == null) {
				return null;
			}
			st = new StringTokenizer(s);
		}
	}

}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class B {
	public static void main(String[] args) throws Exception {
		int n = nextInt();
		int m = nextInt();
		int k = nextInt();
		Integer[] alice = new Integer[n];
		for (int i = 0; i < n; i++) {
			alice[i] = nextInt();
		}
		Arrays.sort(alice);
		Integer[] bob = new Integer[m];
		for (int i = 0; i < m; i++) {
			bob[i] = nextInt();
		}
		Arrays.sort(bob);
		if (alice[n - 1] > bob[m - 1] || n > m) {
			System.out.println("YES");
		} else {
			int j = 0;
			boolean exceeded=false;
			for (int i = 0; j < m && i < n; i++) {
				if (alice[i] <= bob[j]) {
					j++;
				} else if (alice[i] > bob[j]) {
					exceeded=true;
					while (j < m && bob[j] < alice[i]) {
						j++;
					}
				}
			}
			if (j == m&&exceeded) {
				System.out.println("YES");
			} else
				System.out.println("NO");
		}
	}

	static BufferedReader br = new BufferedReader(new InputStreamReader(
			System.in));
	static StringTokenizer st = new StringTokenizer("");

	static int nextInt() throws Exception {
		return Integer.parseInt(next());
	}

	static String next() throws Exception {
		while (true) {
			if (st.hasMoreTokens()) {
				return st.nextToken();
			}
			String s = br.readLine();
			if (s == null) {
				return null;
			}
			st = new StringTokenizer(s);
		}
	}

}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class B {
	public static void main(String[] args) throws Exception {
		int n = nextInt();
		int m = nextInt();
		int k = nextInt();
		Integer[] alice = new Integer[n];
		for (int i = 0; i < n; i++) {
			alice[i] = nextInt();
		}
		Arrays.sort(alice);
		Integer[] bob = new Integer[m];
		for (int i = 0; i < m; i++) {
			bob[i] = nextInt();
		}
		Arrays.sort(bob);
		if (alice[n - 1] > bob[m - 1] || n > m) {
			System.out.println("YES");
		} else {
			if (n == m) {
				for (int i = 0; i < n; i++) {
					if (alice[i] > bob[i]) {
						System.out.println("YES");
						return;
					}
				}
			}
			int j = 0;
			boolean exceeded=false;
			for (int i = 0; j < m && i < n; i++) {
				if (alice[i] <= bob[j]) {
					i++;
					j++;
				} else if (alice[i] > bob[j]) {
					exceeded=true;
					while (j < m && bob[j] < alice[i]) {
						j++;
					}
				}
			}
			if (j == m&&exceeded) {
				System.out.println("YES");
			} else
				System.out.println("NO");
		}
	}

	static BufferedReader br = new BufferedReader(new InputStreamReader(
			System.in));
	static StringTokenizer st = new StringTokenizer("");

	static int nextInt() throws Exception {
		return Integer.parseInt(next());
	}

	static String next() throws Exception {
		while (true) {
			if (st.hasMoreTokens()) {
				return st.nextToken();
			}
			String s = br.readLine();
			if (s == null) {
				return null;
			}
			st = new StringTokenizer(s);
		}
	}

}


import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.ListIterator;
import java.util.Locale;
import java.util.Random;
import java.util.Stack;
import java.util.StringTokenizer;

public class B {

	private void solve() throws IOException {
		int n = nextInt();
		int m = nextInt();
		int k = nextInt();

		Integer[] a = new Integer[n];
		for (int i = 0; i < n; i++) {
			a[i] = nextInt();
		}
		Arrays.sort(a);
		Integer[] b = new Integer[m];
		for (int i = 0; i < m; i++) {
			b[i] = nextInt();
		}
		Arrays.sort(b);

		int A = n - 1;
		int B = m - 1;
		while (A >= 0 || B >= 0) {
			if (B >= 0) {
				if (A < 0 || b[B] >= a[A]) {
					B--;
				} else if (A >= 0) {
					A--;
				}
			} else {
				A--;
			}

			if (n - A > m - B) {
				println("YES");
				return;
			}
		}

		println("NO");
	}

	private String nextToken() throws IOException {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			tokenizer = new StringTokenizer(reader.readLine());
		}
		return tokenizer.nextToken();
	}

	private int nextInt() throws NumberFormatException, IOException {
		return Integer.parseInt(nextToken());
	}

	private double nextDouble() throws NumberFormatException, IOException {
		return Double.parseDouble(nextToken());
	}

	private long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	private void print(Object o) {
		writer.print(o);
	}

	private void println(Object o) {
		writer.println(o);
	}

	private void printf(String format, Object... o) {
		writer.printf(format, o);
	}

	public static void main(String[] args) {
		long time = System.currentTimeMillis();
		Locale.setDefault(Locale.US);
		new B().run();
		System.err.printf("%.3f\n", 1e-3 * (System.currentTimeMillis() - time));
	}

	BufferedReader reader;
	StringTokenizer tokenizer;
	PrintWriter writer;

	private void run() {
		try {
			reader = new BufferedReader(new InputStreamReader(System.in));
			writer = new PrintWriter(System.out);

			solve();
			reader.close();
			writer.close();
		} catch (IOException e) {
			e.printStackTrace();
			System.exit(13);
		}
	}
}


import java.io.*;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Solution297A {

    final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;
    BufferedReader in;
    PrintWriter out;
    StringTokenizer tok = new StringTokenizer("");

    void solve() throws IOException {
        int n = readInt();
        int m = readInt();
        if(n > m) {
            out.println("YES");
            return;
        }
        int k = readInt();
        Integer[] x = new Integer[n];
        for(int i = 0; i < n; i++) {
            x[i] = readInt();
        }
        Integer[] y = new Integer[m];
        for(int i = 0; i < m; i++) {
            y[i] = readInt();
        }

        Arrays.sort(x);
        Arrays.sort(y);

        int curI = n-1;
        int curJ = m-1;
        while(true) {
            if(curI < 0) {
                out.println("NO");
                return;
            }

            if(x[curI] > y[curJ]) {
                out.println("YES");
                return;
            }

            curI--;
            curJ--;
        }
    }

    void init() throws FileNotFoundException {
        if (ONLINE_JUDGE) {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
        } else {
            in = new BufferedReader(new FileReader("input.txt"));
            out = new PrintWriter("output.txt");
        }
    }

    String readString() throws IOException {
        while (!tok.hasMoreTokens()) {
            tok = new StringTokenizer(in.readLine());
        }
        return tok.nextToken();
    }

    int readInt() throws IOException {
        return Integer.parseInt(readString());
    }

    long readLong() throws IOException {
        return Long.parseLong(readString());
    }

    double readDouble() throws IOException {
        return Double.parseDouble(readString());
    }

    int[] readArr(int n) throws IOException {
        int[] res = new int[n];
        for (int i = 0; i < n; i++) {
            res[i] = readInt();
        }
        return res;
    }

    long[] readArrL(int n) throws IOException {
        long[] res = new long[n];
        for (int i = 0; i < n; i++) {
            res[i] = readLong();
        }
        return res;
    }

    public static void main(String[] args) {
        new Solution297A().run();
    }

    public void run() {
        try {
            long t1 = System.currentTimeMillis();
            init();
            solve();
            out.close();
            long t2 = System.currentTimeMillis();
            System.err.println("Time = " + (t2 - t1));
        } catch (Exception e) {
            e.printStackTrace(System.err);
            System.exit(-1);
        }
    }
}


import java.awt.image.*;
import java.io.*;
import java.net.*;
import java.util.*;

import javax.imageio.*;

public class B {
    public static void main(String[] args) throws Exception {
        new B().solve();
        // new FileInputStream(new File("input.txt")),
        // new PrintStream(new FileOutputStream(new File("output.txt"))));
    }

    void solve() throws IOException {
        BufferedReader in = new BufferedReader(new
                InputStreamReader(System.in));
        Scanner sc = new Scanner(System.in);
        String[] sp;

        sp = in.readLine().split(" ");
        int n = Integer.parseInt(sp[0]);
        int m = Integer.parseInt(sp[1]);
        int k = Integer.parseInt(sp[2]);

        Integer[] a = new Integer[n];
        sp = in.readLine().split(" ");
        for (int i = 0; i < n; i++) {
            a[i] = Integer.parseInt(sp[i]);
        }
        Integer[] b = new Integer[m];
        sp = in.readLine().split(" ");
        for (int i = 0; i < m; i++) {
            b[i] = Integer.parseInt(sp[i]);
        }

        Arrays.sort(a);
        Arrays.sort(b);

        int ai = n - 1, bi = m - 1;
        while (ai >= 0) {
            if (bi == -1 || a[ai] > b[bi]) {
                System.out.println("YES");
                return;
            } else {
                ai--;
                bi--;
            }
        }
        System.out.println("NO");
    }
}
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//


import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintStream;
import java.util.Arrays;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.TreeMap;
import java.util.TreeSet;

/**
 * @author Ivan Pryvalov (ivan.pryvalov@gmail.com)
 */
public class Codeforces_Round_180_Div_1__B implements Runnable{

	private void solve() throws IOException {
		int n = scanner.nextInt();//10^5
		int m = scanner.nextInt();//10^5
		int k = scanner.nextInt();//10^9

		int[] c1 = scanner.loadIntArray(n);//Alice
		int[] c2 = scanner.loadIntArray(m);//Robert

		Arrays.sort(c1);
		Arrays.sort(c2);

		TreeMap<Integer, Integer> map = new TreeMap<>();
		for(int w : c2){
			Integer cnt = map.get(w);
			if (cnt==null) cnt=0;
			map.put(w, cnt+1);
		}

		boolean found = true;
		//remove corresponding
		for(int w:c1){
			Entry<Integer,Integer> e = map.ceilingEntry(w);
			if (e==null){
				found = false;
				break;
			}
			int wEff = e.getKey();
			int cnt = e.getValue();
			cnt--;
			if (cnt>0){
				map.put(wEff, cnt);
			}else{
				map.remove(wEff);
			}
		}

		out.println(found?"NO":"YES");

	}

	/////////////////////////////////////////////////
	final int BUF_SIZE = 1024 * 1024 * 8;//important to read long-string tokens properly
	final int INPUT_BUFFER_SIZE = 1024 * 1024 * 8 ;
	final int BUF_SIZE_INPUT = 1024;

	final int BUF_SIZE_OUT = 1024;

	boolean inputFromFile = false;
	String filenamePrefix = "A-small-attempt0";
	String inSuffix = ".in";
	String outSuffix = ".out";

	//InputStream bis;
	//OutputStream bos;
	PrintStream out;
	ByteScanner scanner;
	ByteWriter writer;

//	@Override
	public void run() {
		try{
			InputStream bis = null;
			OutputStream bos = null;
			//PrintStream out = null;
			if (inputFromFile){
				File baseFile = new File(getClass().getResource("/").getFile());
				bis = new BufferedInputStream(
						new FileInputStream(new File(
								baseFile, filenamePrefix+inSuffix)),
								INPUT_BUFFER_SIZE);
				bos = new BufferedOutputStream(
						new FileOutputStream(
								new File(baseFile, filenamePrefix+outSuffix)));
				out = new PrintStream(bos);
			}else{
				bis = new BufferedInputStream(System.in, INPUT_BUFFER_SIZE);
				bos = new BufferedOutputStream(System.out);
				out = new PrintStream(bos);
			}
			scanner = new ByteScanner(bis, BUF_SIZE_INPUT, BUF_SIZE);
			writer = new ByteWriter(bos, BUF_SIZE_OUT);

			solve();
			out.flush();
		}catch (Exception e) {
			e.printStackTrace();
			System.exit(1);
		}
	}

	public interface Constants{
		final static byte ZERO = '0';//48 or 0x30
		final static byte NINE = '9';
		final static byte SPACEBAR = ' '; //32 or 0x20
		final static byte MINUS = '-'; //45 or 0x2d

		final static char FLOAT_POINT = '.';
	}

	public static class EofException extends IOException{
	}

	public static class ByteWriter implements Constants {

		int bufSize = 1024;
		byte[] byteBuf = new byte[bufSize];
		OutputStream os;

		public ByteWriter(OutputStream os, int bufSize){
			this.os = os;
			this.bufSize = bufSize;
		}

		public void writeInt(int num) throws IOException{
	         int byteWriteOffset = byteBuf.length;
	         if (num==0){
	        	 byteBuf[--byteWriteOffset] = ZERO;
	         }else{
	        	 int numAbs = Math.abs(num);
	        	 while (numAbs>0){
	        		 byteBuf[--byteWriteOffset] = (byte)((numAbs % 10) + ZERO);
	        		 numAbs /= 10;
	        	 }
	        	 if (num<0)
	        		 byteBuf[--byteWriteOffset] = MINUS;
	         }
	         os.write(byteBuf, byteWriteOffset, byteBuf.length - byteWriteOffset);
		}

		/**
		 * Please ensure ar.length <= byteBuf.length!
		 *
		 * @param ar
		 * @throws IOException
		 */
		public void writeByteAr(byte[] ar) throws IOException{
			for (int i = 0; i < ar.length; i++) {
				byteBuf[i] = ar[i];
			}
			os.write(byteBuf,0,ar.length);
		}

		public void writeSpaceBar() throws IOException{
			byteBuf[0] = SPACEBAR;
			os.write(byteBuf,0,1);
		}

	}

	public static class ByteScanner implements Constants{

		InputStream is;

		public ByteScanner(InputStream is, int bufSizeInput, int bufSize){
			this.is = is;
			this.bufSizeInput = bufSizeInput;
			this.bufSize = bufSize;

			byteBufInput = new byte[this.bufSizeInput];
			byteBuf = new byte[this.bufSize];
		}

		public ByteScanner(byte[] data){
			byteBufInput = data;
			bufSizeInput = data.length;
			bufSize = data.length;
			byteBuf = new byte[bufSize];
			byteRead = data.length;
			bytePos = 0;
		}

		private int bufSizeInput;
		private int bufSize;

		byte[] byteBufInput;
		byte by=-1;
		int byteRead=-1;
		int bytePos=-1;

		byte[] byteBuf;
		int totalBytes;

		boolean eofMet = false;

		private byte nextByte() throws IOException{

			if (bytePos<0 || bytePos>=byteRead){
				byteRead = is==null? -1: is.read(byteBufInput);
				bytePos=0;
				if (byteRead<0){
					byteBufInput[bytePos]=-1;//!!!
					if (eofMet)
						throw new EofException();
					eofMet = true;
				}
			}
			return byteBufInput[bytePos++];
		}

		/**
		 * Returns next meaningful character as a byte.

		 *
		 * @return
		 * @throws IOException
		 */
		public byte nextChar() throws IOException{
			while ((by=nextByte())<=0x20);
			return by;
		}

		/**
		 * Returns next meaningful character OR space as a byte.

		 *
		 * @return
		 * @throws IOException
		 */
		public byte nextCharOrSpacebar() throws IOException{
			while ((by=nextByte())<0x20);
			return by;
		}

	    /**
	     * Reads line.
	     *
	     * @return
	     * @throws IOException
	     */
	    public String nextLine() throws IOException {
            readToken((byte)0x20);
            return new String(byteBuf,0,totalBytes);
	    }

	    public byte[] nextLineAsArray() throws IOException {
            readToken((byte)0x20);
            byte[] out = new byte[totalBytes];
            System.arraycopy(byteBuf, 0, out, 0, totalBytes);
            return out;
	    }

	    /**
	     * Reads token. Spacebar is separator char.
	     *
	     * @return
	     * @throws IOException
	     */
	    public String nextToken() throws IOException {
            readToken((byte)0x21);
            return new String(byteBuf,0,totalBytes);
	    }

	    /**
	     * Spacebar is included as separator char
	     *
	     * @throws IOException
	     */
	    private void readToken() throws IOException {
            readToken((byte)0x21);
	    }

	    private void readToken(byte acceptFrom) throws IOException {
            totalBytes = 0;
            while ((by=nextByte())<acceptFrom);
            byteBuf[totalBytes++] = by;
            while ((by=nextByte())>=acceptFrom){
                byteBuf[totalBytes++] = by;
            }
	    }

	    public int nextInt() throws IOException{
			readToken();
			int num=0, i=0;
			boolean sign=false;
			if (byteBuf[i]==MINUS){
				sign = true;
				i++;
			}
			for (; i<totalBytes; i++){
				num*=10;
				num+=byteBuf[i]-ZERO;
			}
			return sign?-num:num;
		}

		public long nextLong() throws IOException{
			readToken();
			long num=0;
			int i=0;
			boolean sign=false;
			if (byteBuf[i]==MINUS){
				sign = true;
				i++;
			}
			for (; i<totalBytes; i++){
				num*=10;
				num+=byteBuf[i]-ZERO;
			}
			return sign?-num:num;
		}

		/*
		//TODO test Unix/Windows formats
		public void toNextLine() throws IOException{
			while ((ch=nextChar())!='\n');
		}
		*/

		public double nextDouble() throws IOException{
			readToken();
			char[] token = new char[totalBytes];
			for (int i = 0; i < totalBytes; i++) {
				token[i] = (char)byteBuf[i];
			}
			return Double.parseDouble(new String(token));
		}

		public int[] loadIntArray(int size) throws IOException{
			int[] a = new int[size];
			for (int i = 0; i < a.length; i++) {
				a[i] = nextInt();
			}
			return a;
		}

		public long[] loadLongArray(int size) throws IOException{
			long[] a = new long[size];
			for (int i = 0; i < a.length; i++) {
				a[i] = nextLong();
			}
			return a;
		}

	}

	public static abstract class Timing{
		private static int counter = 0;
		protected String name = "Timing"+(++counter);
		private boolean debug;

		public Timing(boolean debug) {
			super();
			this.debug = debug;
		}

		public abstract void run();
		public void start(){
			long time1 = System.currentTimeMillis();
			run();
			long time2 = System.currentTimeMillis();
			if (debug)
				System.out.println(name+" time = "+(time2-time1)/1000.0+" ms.");
		}

	}

	public static class Alg{
		public static interface BooleanChecker{
			public boolean check(long arg);
		}

		public static class BinarySearch{

			/**
			 * This check returns boolean value, result of function.
			 * It should be monotonic.
			 *
			 * @return
			 */
			public BooleanChecker bc;

			/**
			 * Returns following element:
 0 0 [1] 1 1

			 */
			public long search(long left, long right){
				while (left<=right){
					long mid = (left+right)/2;
					if (bc.check(mid)){
						right = mid-1;
					}else{
						left = mid+1;
					}
				}
				return left;
			}

			/**
			 * Optional.

			 * Returns following element:
 1 1 [1] 0 0

			 */
			public long searchInverted(long left, long right){
				while (left<=right){
					long mid = (left+right)/2;
					if (!bc.check(mid)){
						right = mid-1;
					}else{
						left = mid+1;
					}
				}
				return left - 1;
			}
		}
	}

	public static class Modulo{
		long mod = (long)1e9+7;

		public Modulo(long mod) {
			super();
			this.mod = mod;
		}

		public long inv(long a) {
			long res =  pow(a, mod-2);
			return res;
		}

		public long pow(long a, long x) {
			if (x==0)
				return 1;
			long part = 1;
			if ((x&1)!=0)
				part = a;
			return (part * pow((a*a)%mod, x>>1)) % mod;
		}

		public long c(long n, long m){
			long res = 1;
			for(int i=1; i<=m; i++){
				res = (res * (n-m+i)) % mod;
				res = (res * inv(i)) % mod;
			}
			return res;
		}

	}

	static class DisjointUnionSet implements Cloneable{

		int[] rank;
		int[] parent;

		protected DisjointUnionSet clone(){
			DisjointUnionSet cloned = new DisjointUnionSet(parent.length);
			for(int i=0; i<parent.length; i++){
				cloned.parent[i] = parent[i];
				cloned.rank[i] = rank[i];
			}
			return cloned;
		}

		public DisjointUnionSet(int n) {
			rank = new int[n];
			parent = new int[n];

			for (int i = 0; i < n; i++) {
				parent[i] = i;
			}
		}

		@Override
		public String toString() {
			return "disj [parents=" + Arrays.toString(parent) + "]";
		}

		/**
		 * Problem specific or general?
		 * O(N * alpha)
		 *
		 * @param set2
		 */
		public void union(DisjointUnionSet set2){
			for(int i=0; i<parent.length; i++){
				parent[find(i)] = parent[find(set2.find(i))];
			}
		}

		/**
		 * @param index1 range 0..n-1
		 * @param index2
		 */
		public void union(int index1, int index2){
			int p1 = find(index1);
			int p2 = find(index2);

			if (rank[p1] > rank[p2]){
				parent[p2] = p1;
			}else if (rank[p2] > rank[p1]){
				parent[p1] = p2;
			}else{
				parent[p2] = p1;
				rank[p1]++;
			}
		}

		/**
		 *  O(alpha(n))
		 *
		 * @param index
		 * @return
		 */
		private int find(int index) {
			if (parent[index] != index)
				parent[index] =  find(parent[index]);
			return parent[index];
		}

		/**
		 * O(N alpha(N)) ==> see find()
		 *
		 * @return
		 */
		public int getCountDisjointSets(){
			int[] used = new int[parent.length];
			for(int i=0; i<parent.length; i++){
				used[find(i)] = 1;
			}
			int res = 0;
			for(int i=0; i<parent.length; i++){
				res += used[i];
			}
			return res;
		}
	}

	public static void main(String[] args) {
		new Codeforces_Round_180_Div_1__B().run();
	}

}


import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.util.Arrays;
import java.util.Scanner;
import java.util.StringTokenizer;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author N-AssassiN
 */
public class Main {

    static BufferedReader reader;
    static BufferedWriter writer;
    static StringTokenizer tokenizer;

    /**
     * call this method to initialize reader for InputStream and OututStream
     */
    static void init(InputStream input, OutputStream output) {
        reader = new BufferedReader(new InputStreamReader(input));
        writer = new BufferedWriter(new OutputStreamWriter(output));
        tokenizer = new StringTokenizer("");
    }

    /**
     * get next word
     */
    static String next() throws IOException {
        while (!tokenizer.hasMoreTokens()) {
            //TODO add check for eof if necessary
            tokenizer = new StringTokenizer(reader.readLine());
        }
        return tokenizer.nextToken();
    }

    static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    static long nextLong() throws IOException {
        return Long.parseLong(next());
    }

    static double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }

    public static void main(String[] args) throws IOException {
        init(System.in, System.out);
        int n = nextInt();
        int m = nextInt();
        int k = nextInt();
        int[] alice = new int[n];
        int[] bob = new int[m];
        int i;
        for (i = 0; i < n; i++) {
            alice[i] = nextInt();
        }
        for (i = 0; i < m; i++) {
            bob[i] = nextInt();
        }
        if (n > m) {
            writer.write("YES\n");
        } else {
            Arrays.sort(alice);
            Arrays.sort(bob);
            if (n == m) {
                boolean yes = true;
                for (i = 0; i < n; i++) {
                    if (alice[i] > bob[i]) {
                        writer.write("YES\n");
                        yes = false;
                        break;
                    }
                }
                if (yes) {
                    writer.write("NO\n");
                }
            } else {
                boolean yes = true;
                for (i = 0; i < n; i++) {
                    if (alice[i] > bob[i + m - n]) {
                        writer.write("YES\n");
                        yes = false;
                        break;
                    }
                }
                if (yes) {
                    writer.write("NO\n");
                }
            }
        }
        writer.flush();
    }
}


import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.util.Arrays;
import java.util.Scanner;
import java.util.StringTokenizer;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author N-AssassiN
 */
public class Main {

    static BufferedReader reader;
    static BufferedWriter writer;
    static StringTokenizer tokenizer;

    /**
     * call this method to initialize reader for InputStream and OututStream
     */
    static void init(InputStream input, OutputStream output) {
        reader = new BufferedReader(new InputStreamReader(input));
        writer = new BufferedWriter(new OutputStreamWriter(output));
        tokenizer = new StringTokenizer("");
    }

    /**
     * get next word
     */
    static String next() throws IOException {
        while (!tokenizer.hasMoreTokens()) {
            //TODO add check for eof if necessary
            tokenizer = new StringTokenizer(reader.readLine());
        }
        return tokenizer.nextToken();
    }

    static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }

    static long nextLong() throws IOException {
        return Long.parseLong(next());
    }

    static double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }

    public static void main(String[] args) throws IOException {
        init(System.in, System.out);
        int n = nextInt();
        int m = nextInt();
        int k = nextInt();
        int[] alice = new int[n];
        int[] bob = new int[m];
        int i;
        for (i = 0; i < n; i++) {
            alice[i] = nextInt();
        }
        for (i = 0; i < m; i++) {
            bob[i] = nextInt();
        }
        if (n > m) {
            writer.write("YES\n");
        } else {
            Arrays.sort(alice);
            Arrays.sort(bob);
            if (n == m) {
                for (i = 0; i < n; i++) {
                    if (alice[i] > bob[i]) {
                        writer.write("YES\n");
                        System.exit(0);
                    }
                }
                writer.write("NO\n");
            } else {
                for (i = 0; i < n; i++) {
                    if (alice[i] > bob[i + m - n]) {
                        writer.write("YES\n");
                        System.exit(0);
                    }
                }
                writer.write("NO\n");
            }
        }
        writer.flush();
    }
}


import java.io.*;
import java.util.*;

import static java.lang.Math.*;

public class B implements Runnable {

	BufferedReader in;
	PrintWriter out;
	StringTokenizer tok;

	public static void main(String[] args) {
		new Thread(null, new B(), "", 64*1024*1024).start();
		//new Template().run();
	}

	public void run() {
		try {
			long t1 = 0, t2 = 0;
			if (LOCAL) {
				t1 = System.currentTimeMillis();
			}
			Locale.setDefault(Locale.US);
			if (LOCAL) {
				in = new BufferedReader(new FileReader("input.txt"));
				out = new PrintWriter("output.txt");
			} else {
				in = new BufferedReader(new InputStreamReader(System.in));
				out = new PrintWriter(System.out);
			}
			tok = new StringTokenizer("");
			solve();
			in.close();
			out.close();
			if (LOCAL) {
				t2 = System.currentTimeMillis();
				System.err.println("Time = " + (t2 - t1) + " ms.");
			}
		} catch (Throwable e) {
			e.printStackTrace(System.err);
			throw new RuntimeException();
		}
	}

	String readString() throws IOException {
		while (!tok.hasMoreTokens()) {
			String line = in.readLine();
			if (line == null) return null;
			tok = new StringTokenizer(line);
		}
		return tok.nextToken();
	}

	int readInt() throws IOException {
		return Integer.parseInt(readString());
	}

	long readLong() throws IOException {
		return Long.parseLong(readString());
	}

	double readDouble() throws IOException {
		return Double.parseDouble(readString());
	}

	static class Mergesort {

		private Mergesort() {}

		public static void sort(int[] a) {
			mergesort(a, 0, a.length - 1);
		}

		public static void sort(long[] a) {
			mergesort(a, 0, a.length - 1);
		}

		public static void sort(double[] a) {
			mergesort(a, 0, a.length - 1);
		}

		private static final int MAGIC_VALUE = 42;

		private static void mergesort(int[] a, int leftIndex, int rightIndex) {
			if (leftIndex < rightIndex) {
				if (rightIndex - leftIndex <= MAGIC_VALUE) {
					insertionSort(a, leftIndex, rightIndex);
				} else {
					int middleIndex = (leftIndex + rightIndex) / 2;
					mergesort(a, leftIndex, middleIndex);
					mergesort(a, middleIndex + 1, rightIndex);
					merge(a, leftIndex, middleIndex, rightIndex);
				}
			}
		}

		private static void mergesort(long[] a, int leftIndex, int rightIndex) {
			if (leftIndex < rightIndex) {
				if (rightIndex - leftIndex <= MAGIC_VALUE) {
					insertionSort(a, leftIndex, rightIndex);
				} else {
					int middleIndex = (leftIndex + rightIndex) / 2;
					mergesort(a, leftIndex, middleIndex);
					mergesort(a, middleIndex + 1, rightIndex);
					merge(a, leftIndex, middleIndex, rightIndex);
				}
			}
		}

		private static void mergesort(double[] a, int leftIndex, int rightIndex) {
			if (leftIndex < rightIndex) {
				if (rightIndex - leftIndex <= MAGIC_VALUE) {
					insertionSort(a, leftIndex, rightIndex);
				} else {
					int middleIndex = (leftIndex + rightIndex) / 2;
					mergesort(a, leftIndex, middleIndex);
					mergesort(a, middleIndex + 1, rightIndex);
					merge(a, leftIndex, middleIndex, rightIndex);
				}
			}
		}

		private static void merge(int[] a, int leftIndex, int middleIndex, int rightIndex) {
			int length1 = middleIndex - leftIndex + 1;
			int length2 = rightIndex - middleIndex;
			int[] leftArray = new int[length1];
			int[] rightArray = new int[length2];
			System.arraycopy(a, leftIndex, leftArray, 0, length1);
			System.arraycopy(a, middleIndex + 1, rightArray, 0, length2);
			for (int k = leftIndex, i = 0, j = 0; k <= rightIndex; k++) {
				if (i == length1) {
					a[k] = rightArray[j++];
				} else if (j == length2) {
					a[k] = leftArray[i++];
				} else {
					a[k] = leftArray[i] <= rightArray[j] ? leftArray[i++] : rightArray[j++];
				}
			}
		}

		private static void merge(long[] a, int leftIndex, int middleIndex, int rightIndex) {
			int length1 = middleIndex - leftIndex + 1;
			int length2 = rightIndex - middleIndex;
			long[] leftArray = new long[length1];
			long[] rightArray = new long[length2];
			System.arraycopy(a, leftIndex, leftArray, 0, length1);
			System.arraycopy(a, middleIndex + 1, rightArray, 0, length2);
			for (int k = leftIndex, i = 0, j = 0; k <= rightIndex; k++) {
				if (i == length1) {
					a[k] = rightArray[j++];
				} else if (j == length2) {
					a[k] = leftArray[i++];
				} else {
					a[k] = leftArray[i] <= rightArray[j] ? leftArray[i++] : rightArray[j++];
				}
			}
		}

		private static void merge(double[] a, int leftIndex, int middleIndex, int rightIndex) {
			int length1 = middleIndex - leftIndex + 1;
			int length2 = rightIndex - middleIndex;
			double[] leftArray = new double[length1];
			double[] rightArray = new double[length2];
			System.arraycopy(a, leftIndex, leftArray, 0, length1);
			System.arraycopy(a, middleIndex + 1, rightArray, 0, length2);
			for (int k = leftIndex, i = 0, j = 0; k <= rightIndex; k++) {
				if (i == length1) {
					a[k] = rightArray[j++];
				} else if (j == length2) {
					a[k] = leftArray[i++];
				} else {
					a[k] = leftArray[i] <= rightArray[j] ? leftArray[i++] : rightArray[j++];
				}
			}
		}

		private static void insertionSort(int[] a, int leftIndex, int rightIndex) {
			for (int i = leftIndex + 1; i <= rightIndex; i++) {
				int current = a[i];
				int j = i - 1;
				while (j >= leftIndex && a[j] > current) {
					a[j + 1] = a[j];
					j--;
				}
				a[j + 1] = current;
			}
		}

		private static void insertionSort(long[] a, int leftIndex, int rightIndex) {
			for (int i = leftIndex + 1; i <= rightIndex; i++) {
				long current = a[i];
				int j = i - 1;
				while (j >= leftIndex && a[j] > current) {
					a[j + 1] = a[j];
					j--;
				}
				a[j + 1] = current;
			}
		}

		private static void insertionSort(double[] a, int leftIndex, int rightIndex) {
			for (int i = leftIndex + 1; i <= rightIndex; i++) {
				double current = a[i];
				int j = i - 1;
				while (j >= leftIndex && a[j] > current) {
					a[j + 1] = a[j];
					j--;
				}
				a[j + 1] = current;
			}
		}

	}

	void debug(Object... o) {
		if (LOCAL) {
			System.err.println(Arrays.deepToString(o));
		}
	}

	final static boolean LOCAL = System.getProperty("ONLINE_JUDGE") == null;//System.getProperty("os.name") != null && System.getProperty("os.name").contains("Windows");//

//------------------------------------------------------------------------------

	void solve() throws IOException {
		int n = readInt();
		int m = readInt();
		int k = readInt();
		int[] a = new int[n];
		int[] b = new int[m];
		for (int i = 0; i < n; i++) {
			a[i] = readInt();
		}
		for (int i = 0; i < m; i++) {
			b[i] = readInt();
		}
		if (n > m) {
			out.println("YES");
			return;
		}
		Mergesort.sort(a);
		Mergesort.sort(b);
		TreeMap<Integer, Integer> map = new TreeMap<Integer, Integer>();
		for (int i = 0, j = 0; i < n || j < m; ) {
			if (j == m) {
				add(map, a[i++]);
			} else if (i == n) {
				add(map, b[j++]);
			} else if (a[i] < b[j]) {
				add(map, a[i++]);
			} else {
				add(map, b[j++]);
			}
		}
		for (int i = 0; i < n; i++) {
			a[i] = map.get(a[i]);
		}
		for (int i = 0; i < m; i++) {
			b[i] = map.get(b[i]);
		}
		int[] acnts = new int[map.size()];
		int[] bcnts = new int[map.size()];
		for (int x : a) {
			acnts[x]++;
		}
		for (int x : b) {
			bcnts[x]++;
		}
		debug(acnts);
		debug(bcnts);
		for (int i = 1; i < acnts.length; i++) {
			acnts[i] += acnts[i-1];
		}
		for (int i = 1; i < bcnts.length; i++) {
			bcnts[i] += bcnts[i-1];
		}
		debug(acnts);
		debug(bcnts);
		for (int begin = 0; begin <= acnts.length - 1; begin++) {
			int asum = getSum(acnts, begin, acnts.length - 1);
			int bsum = getSum(bcnts, begin, bcnts.length - 1);
			debug(asum, bsum);
			if (asum > bsum) {
				out.println("YES");
				return;
			}
		}
		out.println("NO");
	}

	private void add(TreeMap<Integer, Integer> map, int x) {
		if (!map.containsKey(x)) {
			map.put(x, map.size());
		}
	}

	private int getSum(int[] a, int L, int R) {
		int s = a[R];
		if (L > 0) s -= a[L-1];
		return s;
	}

}


import java.io.*;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.StringTokenizer;

public class B implements Runnable {

    SimpleTextReader in;
    PrintWriter out;

    int n, m, k;
    int[] a;
    int[] b;

    @Override
    public void run() {
        in = new SimpleTextReader(System.in);
        out = new PrintWriter(System.out);

        n = in.nextInt();
        m = in.nextInt();
        k = in.nextInt();

        a = new int[n];
        b = new int[m];

        for (int i = 0; i < n; i++) {
            a[i] = in.nextInt();
        }

        for (int i = 0; i < m; i++) {
            b[i] = in.nextInt();
        }
        Arrays.sort(a);
        Arrays.sort(b);

        boolean yes = false;
        int pb = 0;
        for (int pa = 0; pa < n; pa++) {
            int wa = a[pa];
            while (pb < m && b[pb] < wa) {
                pb++;
            }
            if (pb >= m) {
                yes = true;
                break;
            }
            pb++;
        }

        out.println(yes ? "YES" : "NO");

        out.close();
    }

    public class SimpleTextReader {
        private final BufferedReader in;
        private StringTokenizer tokenizer = new StringTokenizer("");

        public SimpleTextReader(InputStream inputStream) {
            in = new BufferedReader(new InputStreamReader(inputStream));
        }

        public String nextToken() {
            while (!tokenizer.hasMoreTokens()) {
                String line = null;
                try {
                    line = in.readLine();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
                if (line == null) {
                    return null;
                }
                tokenizer = new StringTokenizer(line);
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(nextToken());
        }

        public BigInteger nextBigInt() {
            return new BigInteger(nextToken());
        }

        public long nextLong() {
            return Long.parseLong(nextToken());
        }

        public double nextDouble() {
            return Double.parseDouble(nextToken());
        }

        public void close() throws IOException {
            in.close();
        }
    }

    public static void main(String[] args) {
        new Thread(new B()).start();
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Map;
import java.util.StringTokenizer;
import java.util.TreeMap;

public class D {

    public static void main(String[] args) {
        InputReader in = new InputReader(System.in);
        int n = in.nextInt();
        int m = in.nextInt();
        in.nextInt();
        int[] memo1 = new int[n];
        int[] memo2 = new int[m];
        for (int i = 0; i < n; i++) {
            memo1[i] = in.nextInt();
        }
        for (int i = 0; i < m; i++) {
            memo2[i] = in.nextInt();
        }
        Arrays.sort(memo1);
        Arrays.sort(memo2);
        if (memo1[n - 1] > memo2[m - 1]) {
            System.out.println("YES");
        } else {
            int diff = 0;
            m--;
            n--;
            while (n >= 0 && m >= 0) {
                int i = m;
                while (i >= 0 && memo2[i] == memo2[m]) {
                    i--;
                }
                if (i < 0) {
                    break;
                }
                int j = n;
                while (j >= 0 && memo1[j] > memo2[i]) {
                    j--;
                }
                diff += (m - i) - (n - j);
                if (diff < 0) {
                    System.out.println("YES");
                    return;
                }
                m = i;
                n = j;
            }
            System.out.println("NO");
        }
    }

    static class InputReader {
        private BufferedReader reader;
        private StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
            tokenizer = null;
        }

        public String nextLine() {
            try {
                return reader.readLine();
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
                return null;
            }
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Map;
import java.util.StringTokenizer;
import java.util.TreeMap;

public class D {

	public static void main(String[] args) {
		InputReader in = new InputReader(System.in);
		int n = in.nextInt();
		int m = in.nextInt();
		in.nextInt();
		int[] memo1 = new int[n];
		int[] memo2 = new int[m];
		for (int i = 0; i < n; i++) {
			memo1[i] = in.nextInt();
		}
		for (int i = 0; i < m; i++) {
			memo2[i] = in.nextInt();
		}
		Arrays.sort(memo1);
		Arrays.sort(memo2);
		if (memo1[n - 1] > memo2[m - 1]) {
			System.out.println("YES");
		} else {
			long diff = 0;
			m--;
			n--;
			while (n >= 0 && m >= 0) {
				int i = m;
				while (i >= 0 && memo2[i] == memo2[m]) {
					i--;
				}
				if (i < 0) {
					break;
				}
				int j = n;
				while (j >= 0 && memo1[j] > memo2[i]) {
					j--;
				}
				diff += (((long) m) - i) - (((long) n) - j);
				if (diff < 0) {
					System.out.println("YES");
					return;
				}
				m = i;
				n = j;
			}
			System.out.println("NO");
		}
	}

	static class InputReader {
		private BufferedReader reader;
		private StringTokenizer tokenizer;

		public InputReader(InputStream stream) {
			reader = new BufferedReader(new InputStreamReader(stream));
			tokenizer = null;
		}

		public String nextLine() {
			try {
				return reader.readLine();
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
				return null;
			}
		}

		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}

		public long nextLong() {
			return Long.parseLong(next());
		}

		public double nextDouble() {
			return Double.parseDouble(next());
		}
	}
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.StringTokenizer;

public class D {

    public static void main(String[] args) {
        InputReader in = new InputReader(System.in);
        int n = in.nextInt();
        int m = in.nextInt();
        in.nextInt();
        int[] memo1 = new int[n];
        int[] memo2 = new int[m];
        for (int i = 0; i < n; i++) {
            memo1[i] = in.nextInt();
        }
        for (int i = 0; i < m; i++) {
            memo2[i] = in.nextInt();
        }
        Arrays.sort(memo1);
        Arrays.sort(memo2);
        ArrayList<Integer> merg = new ArrayList<Integer>();
        int i = 0;
        int j = 0;
        while (i < n && j < m) {
            if (memo1[i] == memo2[j]) {
                i++;
                j++;
            } else if (memo1[i] > memo2[j]) {
                merg.add(2);
                j++;
            } else {
                merg.add(1);
                i++;
            }
        }
        while (i < n) {
            merg.add(1);
            i++;
        }
        while (j < m) {
            merg.add(2);
            j++;
        }
        int dif = 0;
        for (i = merg.size() - 1; i >= 0;) {
            while (i >= 0 && merg.get(i) == 1) {
                dif--;
                i--;
            }
            if (dif < 0) {
                System.out.println("YES");
                return;
            }
            while (i >= 0 && merg.get(i) == 2) {
                dif++;
                i--;
            }
        }
        System.out.println("NO");
    }

    static class InputReader {
        private BufferedReader reader;
        private StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
            tokenizer = null;
        }

        public String nextLine() {
            try {
                return reader.readLine();
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
                return null;
            }
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Map;
import java.util.StringTokenizer;
import java.util.TreeMap;

public class D {

    public static void main(String[] args) {
        InputReader in = new InputReader(System.in);
        int n = in.nextInt();
        int m = in.nextInt();
        in.nextInt();
        int[] memo1 = new int[n];
        int[] memo2 = new int[m];
        for (int i = 0; i < n; i++) {
            memo1[i] = in.nextInt();
        }
        for (int i = 0; i < m; i++) {
            memo2[i] = in.nextInt();
        }
        Arrays.sort(memo1);
        Arrays.sort(memo2);
        if (memo1[n - 1] > memo2[m - 1]) {
            System.out.println("YES");
        } else {
            int diff = 0;
            m--;
            n--;
            while (n >= 0 && m >= 0) {
                int i = m;
                while (i >= 0 && memo2[i] == memo2[m]) {
                    i--;
                }
                if (i < 0) {
                    break;
                }
                int j = n;
                while (j >= 0 && memo1[j] > memo2[i]) {
                    j--;
                }
                diff = (m - i) - (n - j);
                if (diff < 0) {
                    System.out.println("YES");
                    return;
                }
                m = i;
                n = j;
            }
            System.out.println("NO");
        }
    }

    static class InputReader {
        private BufferedReader reader;
        private StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
            tokenizer = null;
        }

        public String nextLine() {
            try {
                return reader.readLine();
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
                return null;
            }
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Map;
import java.util.StringTokenizer;
import java.util.TreeMap;

public class D {

    public static void main(String[] args) {
        InputReader in = new InputReader(System.in);
        int n = in.nextInt();
        int m = in.nextInt();
        in.nextInt();
        int[] memo1 = new int[n];
        int[] memo2 = new int[m];
        for (int i = 0; i < n; i++) {
            memo1[i] = in.nextInt();
        }
        for (int i = 0; i < m; i++) {
            memo2[i] = in.nextInt();
        }
        Arrays.sort(memo1);
        Arrays.sort(memo2);
        if (memo1[n - 1] > memo2[m - 1]) {
            System.out.println("YES");
        } else {
            long diff = 0;
            m--;
            n--;
            while (n >= 0 && m >= 0) {
                int i = m;
                while (i >= 0 && memo2[i] == memo2[m]) {
                    i--;
                }
                if (i < 0) {
                    break;
                }
                int j = n;
                while (j >= 0 && memo1[j] > memo2[i]) {
                    j--;
                }
                diff += (m - i) - (n - j);
                if (diff < 0) {
                    System.out.println("YES");
                    return;
                }
                m = i;
                n = j;
            }
            System.out.println("NO");
        }
    }

    static class InputReader {
        private BufferedReader reader;
        private StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
            tokenizer = null;
        }

        public String nextLine() {
            try {
                return reader.readLine();
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
                return null;
            }
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.StringTokenizer;

public class D {

    public static void main(String[] args) {
        InputReader in = new InputReader(System.in);
        int n = in.nextInt();
        int m = in.nextInt();
        in.nextInt();
        int[] memo1 = new int[n];
        int[] memo2 = new int[m];
        for (int i = 0; i < n; i++) {
            memo1[i] = in.nextInt();
        }
        for (int i = 0; i < m; i++) {
            memo2[i] = in.nextInt();
        }
        Arrays.sort(memo1);
        Arrays.sort(memo2);
        ArrayList<Integer> merg = new ArrayList<Integer>();
        int i = 0;
        int j = 0;
        while (i < n && j < m) {
            if (memo1[i] == memo2[j]) {
                i++;
                j++;
            }
            if (memo1[i] > memo2[j]) {
                merg.add(2);
                j++;
            } else {
                merg.add(1);
                i++;
            }
        }
        while (i < n) {
            merg.add(1);
            i++;
        }
        while (j < m) {
            merg.add(2);
            j++;
        }
        int dif = 0;
        for (i = merg.size() - 1; i >= 0;) {
            while (i >= 0 && merg.get(i) == 1) {
                dif--;
                i--;
            }
            if (dif < 0) {
                System.out.println("YES");
                return;
            }
            while (i >= 0 && merg.get(i) == 2) {
                dif++;
                i--;
            }
        }
        System.out.println("NO");
    }

    static class InputReader {
        private BufferedReader reader;
        private StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
            tokenizer = null;
        }

        public String nextLine() {
            try {
                return reader.readLine();
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
                return null;
            }
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }
    }
}


#include<cstdio>
#include<algorithm>
#include<map>
#define N 100005
using namespace std;
int aa[N],bb[N];
map<int,int> mp1,mp2;
int main(){
	int n,m,k,l1=0,l2=0,b=0,a,f=0;
	scanf("%d%d%d",&n,&m,&k);
	for(int i=0;i<n;i++){
		scanf("%d",&a);
		if(mp1[a]==0)aa[l1++]=a;mp1[a]++;
	}
	for(int i=0;i<m;i++){
		scanf("%d",&a);
		if(mp2[a]==0)bb[l2++]=a;mp2[a]++;
	}
	for(int i=0;i<l2;i++){
		mp1[bb[i]]-=mp2[bb[i]];
		if(mp1[bb[i]]<0)aa[l1++]=bb[i];
	}sort(aa,aa+l1);a=0;
	for(int i=l1-1;i>=0;i--){
		if(mp1[i]<0)b+=abs(mp1[i]);
		else if(mp1[i]>0){
			a+=mp1[i];
			if(a>b){f=1;break;}
		}
	}if(f)printf("YES");else printf("NO");
	return 0;
}


#include<cstdio>
#include<algorithm>
#include<map>
#define N 100005
using namespace std;
int aa[N],bb[N];
map<int,int> mp1,mp2;
int main(){
	int n,m,k,l1=0,l2=0,b=0,a,f=0;
	scanf("%d%d%d",&n,&m,&k);
	for(int i=0;i<n;i++){
		scanf("%d",&a);
		if(mp1[a]==0)aa[l1++]=a;mp1[a]++;
	}
	for(int i=0;i<m;i++){
		scanf("%d",&a);
		if(mp2[a]==0)bb[l2++]=a;mp2[a]++;
	}
	for(int i=0;i<l2;i++){
		a=mp1[bb[i]];
		mp1[bb[i]]-=mp2[bb[i]];
		if(mp1[bb[i]]<0&&a==0)aa[l1++]=bb[i];
	}sort(aa,aa+l1);a=0;
	for(int i=l1-1;i>=0;i--){
		//printf("%d ",mp1[aa[i]]);
		if(mp1[aa[i]]<0)b+=abs(mp1[aa[i]]);
		else if(mp1[aa[i]]>0){
			a+=mp1[aa[i]];
			if(a>b){f=1;break;}
		}
	}
	if(f)printf("YES");else printf("NO");
	return 0;
}


#include<cstdio>
#include<algorithm>
#include<map>
#define N 100005
using namespace std;
int aa[N],bb[N];
map<int,int> mp1,mp2;
int main(){
	int n,m,k,l1=0,l2=0,b=0,a,f=0;
	scanf("%d%d%d",&n,&m,&k);
	for(int i=0;i<n;i++){
		scanf("%d",&a);
		if(mp1[a]==0)aa[l1++]=a;mp1[a]++;
	}
	for(int i=0;i<m;i++){
		scanf("%d",&a);
		if(mp2[a]==0)bb[l2++]=a;mp2[a]++;
	}
	for(int i=0;i<l2;i++){
		mp1[bb[i]]-=mp2[bb[i]];
		if(mp1[bb[i]]<0)aa[l1++]=bb[i];
	}sort(aa,aa+l1);a=0;
	for(int i=l1-1;i>=0;i--){
		//printf("%d ",mp1[aa[i]]);
		if(mp1[aa[i]]<0)b+=abs(mp1[aa[i]]);
		else if(mp1[aa[i]]>0){
			a+=mp1[aa[i]];
			if(a>b){f=1;break;}
		}
	}
	if(f)printf("YES");else printf("NO");
	return 0;
}


#include<cstdio>
#include<algorithm>
#include<map>
#define N 100005
using namespace std;
int aa[2*N],bb[N];
map<int,int> mp1,mp2;
int main(){
	int n,m,k,l1=0,l2=0,b=0,a,f=0;
	scanf("%d%d%d",&n,&m,&k);
	for(int i=0;i<n;i++){
		scanf("%d",&a);
		if(mp1[a]==0)aa[l1++]=a;mp1[a]++;
	}
	for(int i=0;i<m;i++){
		scanf("%d",&a);
		if(mp2[a]==0)bb[l2++]=a;mp2[a]++;
	}
	for(int i=0;i<l2;i++){
		a=mp1[bb[i]];
		mp1[bb[i]]-=mp2[bb[i]];
		if(mp1[bb[i]]<0&&a==0)aa[l1++]=bb[i];
	}sort(aa,aa+l1);a=0;
	for(int i=l1-1;i>=0;i--){
		//printf("%d ",mp1[aa[i]]);
		if(mp1[aa[i]]<0)b+=abs(mp1[aa[i]]);
		else if(mp1[aa[i]]>0){
			a+=mp1[aa[i]];
			if(a>b){f=1;break;}
		}
	}
	if(f)printf("YES");else printf("NO");
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5+10;
vector <int> v , g;
int main(){
    int n , m , k; cin >> n >> m >> k;
    for(int i = 1;i <= n;i++){
    	int x; cin >> x;
    	v.push_back(x);
	}
	for(int i = 1;i <= m;i++){
		int x; cin >> x;
		g.push_back(x);
	}
	sort(v.begin(),v.end());
	sort(g.begin(),g.end());
	while(v.size()){
		if(g.size() == 0) return cout << "YES" << endl , 0;
		int sv = v.size() - 1;
		int gv = g.size() - 1;
		if(v[sv] > g[gv])
			return cout << "YES" << endl , 0;
		g.pop_back();
		v.pop_back();
	}
	return cout << "NO" << endl , 0;
}


#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5+10;
vector <int> v , g;
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie();
    int n , m , k; cin >> n >> m >> k;
    for(int i = 1;i <= n;i++){
    	int x; cin >> x;
    	v.push_back(x);
	}
	for(int i = 1;i <= m;i++){
		int x; cin >> x;
		g.push_back(x);
	}
	sort(v.begin(),v.end());
	sort(g.begin(),g.end());
	while(v.size()){
		if(g.size() == 0) return cout << "YES" << endl , 0;
		int sv = v.size() - 1;
		int gv = g.size() - 1;
		if(v[sv] > g[gv])
			return cout << "YES" << endl , 0;
		g.pop_back();
		v.pop_back();
	}
	return cout << "NO" << endl , 0;
}


#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5+10;
vector <int> v , g;
int main(){
    int n , m , k; cin >> n >> m >> k;
    for(int i = 1;i <= n;i++){
    	int x; cin >> x;
    	v.push_back(x);
	}
	for(int i = 1;i <= m;i++){
		int x; cin >> x;
		g.push_back(x);
	}
	sort(v.begin(),v.end());
	sort(g.begin(),g.end());
	while(v.size()){
		int sv = v.size() - 1;
		int gv = g.size() - 1;
		if(v[sv] == g[gv]){
			v.pop_back();
			g.pop_back();
		}
		if(v[sv] > g[gv]) return cout << "YES" << endl , 0;
		if(g[gv] > v[sv]) g.pop_back();
	}
	return cout << "NO" << endl , 0;
}


#include<bits/stdc++.h>
using namespace std;
bool ok;
int a[444444],b[444444],n,m,k;
int main(){
	scanf("%d%d%d",&n,&m,&k);
	for(int i=0;i<n;i++) scanf("%d",a+i);
	for(int i=0;i<m;i++) scanf("%d",b+i);
	sort(a,a+n);
	sort(b,b+m);
	if(n>m) ok=1;
	else{
		for(int i=0;i<n;i++)
		if(a[i]>b[m-n+i]) ok=1;
	}
	if(ok) printf("YES\n");
	else printf("NO\n");
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n,m,k;
map<int,int> mp;
int main()
{
	cin>>n>>m>>k;
	for(int i=0;i<n;i++)
	{
		int x;
		cin>>x;
		++mp[-x];
	}
	for(int i=0;i<m;i++)
	{
		int x;
		cin>>x;
		--mp[-x];
	}
	int ps=0;
	for(typeof(mp.begin()) it=mp.begin();it!=mp.end();it++)
	{
		ps+=it->second;
		if(ps>0)
		{
			cout<<"YES"<<endl;
			return 0;
		}
	}
	cout<<"NO"<<endl;
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

/*
    VERIFICAR:
    - Corner cases
    - Estouro de variavel
    - Acesso indevido de memoria

    //MODULO NEGATIVO
    int modulo(int x,int N){
        return (x % N + N) %N;
    }

*/

#define _ ios_base::sync_with_stdio(0);cin.tie(0);
#define endl '\n'
#define f first
#define s second
#define pb push_back

typedef long long ll;
typedef pair<int, int> ii;

const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3fll;

int main() { _
    int n, m, k;
    cin >> n >> m >> k;
    vector<int> a(n);
    vector<int> b(m);
    for(int I=0; I<n; I++) {
        cin >> a[I];
    }
    for(int I=0; I<m; I++) {
        cin >> b[I];
    }
    sort(a.rbegin(), a.rend());
    sort(b.rbegin(), b.rend());
    for(int I=0; I<min(n, m); I++) {
        if(a[I] > b[I]) {
            cout << "YES" << endl;
            return 0;
        }
    }
    cout << "NO" << endl;
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

/*
    VERIFICAR:
    - Corner cases
    - Estouro de variavel
    - Acesso indevido de memoria

    //MODULO NEGATIVO
    int modulo(int x,int N){
        return (x % N + N) %N;
    }

*/

#define _ ios_base::sync_with_stdio(0);cin.tie(0);
#define endl '\n'
#define f first
#define s second
#define pb push_back

typedef long long ll;
typedef pair<int, int> ii;

const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3fll;

int main() { _
    int n, m, k;
    cin >> n >> m >> k;
    vector<int> a(n);
    vector<int> b(m);
    for(int I=0; I<n; I++) {
        cin >> a[I];
    }
    for(int I=0; I<m; I++) {
        cin >> b[I];
    }
    sort(a.rbegin(), a.rend());
    sort(b.rbegin(), b.rend());
    for(int I=0; I<min(n, m); I++) {
        if(a[I] > b[I]) {
            cout << "YES" << endl;
            return 0;
        }
    }
    if(n > m) {
        cout << "YES" << endl;
    } else {
        cout << "NO" << endl;
    }
	return 0;
}


/* -*- coding: utf-8; tab-width: 4 -*- */

#include <cstdio>
#include <algorithm>

int
main()
{
	int n, m, k;
	int a[100000];
	int b[100000];

	std::scanf("%d%d%d", &n, &m, &k);

	for (int i(0); i < n; ++i) std::scanf("%d", a + i);
	for (int i(0); i < m; ++i) std::scanf("%d", b + i);
	std::stable_sort(a, a + n);
	std::stable_sort(b, b + m);

	for (int i(0); i < n; ++i) {
		int j = (int)(std::lower_bound(b, b + m, a[i]) - b);
		if (n - i <= m - j) continue;
		std::puts("YES");
		goto E;
	}

	std::puts("NO");

E:

	return 0;
}


/* -*- coding: utf-8; tab-width: 4 -*- */

#include <cstdio>
#include <algorithm>

int
main()
{
	int n, m, k;
	int v, c, mi(1000000001), ma(0);
	bool f(false);

	std::scanf("%d%d%d", &n, &m, &k);
	c = m;

	for (int i(0); i < n; ++i) {
		std::scanf("%d", &v);
		mi = std::min(mi, v);
		ma = std::max(ma, v);
	}

	for (int i(0); i < m; ++i) {
		std::scanf("%d", &v);
		c -= v < mi;
		f |= ma <= v;
	}

	if (c < n || !f) std::puts("YES");
	else std::puts("NO");

	return 0;
}


/* -*- coding: utf-8; tab-width: 4 -*- */

#include <cstdio>
#include <algorithm>

int
main()
{
	int n, m, k;
	int a[100000];
	int b[100000];

	std::scanf("%d%d%d", &n, &m, &k);

	for (int i(0); i < n; ++i) std::scanf("%d", a + i);
	for (int i(0); i < m; ++i) std::scanf("%d", b + i);
	std::stable_sort(a, a + n);
	std::stable_sort(b, b + m);

	for (int i(0); i < n; ++i) {
		int j = (int)(std::lower_bound(b, b + m, a[i]) - b);
		if (n - i < m - j) continue;
		std::puts("YES");
		goto E;
	}

	std::puts("NO");

E:

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int (i) = 0; (i) < (n); (i) ++)
#define rep1(i, n) for (int (i) = 1; (i) <= (n); (i) ++)
#define FOR(i, a, b) for (int (i) = (a); (i) <= (b); (i) ++)
#define ROF(i, a, b) for (int (i) = (a); (i) >= (b); (i) --)

#define endl '\n'
#define all(x) x.begin(),x.end()
#define mp make_pair
#define ll long long
#define ld long double
#define pb push_back

#define M 1000000007

#define pi 3.1415926535897932384626433832795028
#define F first
#define S second
int gcd(int a,int b){
	while (a&&b)a>b?a%=b:b%=a;
	return a+b;
}
ll lcm(ll a, ll b){
	return (a*b)/gcd(a,b);
}
ll fast_exp(ll base, ll exp){
	ll res = 1;
	while(exp>0){
		if(exp%2==1) res = ((res%M)*(base%M))%M;
		base = ((base%M)*(base%M))%M;
		exp/=2;
	}
	return res%M;
}
const int INF = INT_MAX;
const ll INFL = LLONG_MAX;
map < int , int > cnt;
int main(){
	std::ios::sync_with_stdio(0);
	cin.tie(0);
	int n,m,k;
	cin>>n>>m>>k;
	vector < int > A,B;
	rep(i,n){
		cin>>k;
		A.pb(k);
		cnt[k]++;
	}
	rep(i,m){
		cin>>k;
		B.pb(k);
		cnt[k]--;
	}
	vector < int > n1,n2;
	rep(i,A.size()){
		int z = cnt[A[i]];
		while(z>0){
			n1.pb(A[i]);
			z--;
		}
	}
	rep(i,B.size()){
		int z = cnt[B[i]];
		while(z<0){
			n2.pb(B[i]);
			z++;
		}
	}
	sort(all(n1));
	sort(all(n2));
	int i = 0,j=0,ans=0;
	while(i<n1.size() && j<n2.size()){
		if(n1[i]<n2[j]){
			i++;
		}
		else if(n1[i]>n2[j]){
			ans++;
			j++;
		}
	}
	//cout<<ans<<endl;
	if(ans>0){
		cout<<"YES"<<endl;
	}
	else cout<<"NO"<<endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int (i) = 0; (i) < (n); (i) ++)
#define rep1(i, n) for (int (i) = 1; (i) <= (n); (i) ++)
#define FOR(i, a, b) for (int (i) = (a); (i) <= (b); (i) ++)
#define ROF(i, a, b) for (int (i) = (a); (i) >= (b); (i) --)

#define endl '\n'
#define all(x) x.begin(),x.end()
#define mp make_pair
#define ll long long
#define ld long double
#define pb push_back

#define M 1000000007

#define pi 3.1415926535897932384626433832795028
#define F first
#define S second
int gcd(int a,int b){
	while (a&&b)a>b?a%=b:b%=a;
	return a+b;
}
ll lcm(ll a, ll b){
	return (a*b)/gcd(a,b);
}
ll fast_exp(ll base, ll exp){
	ll res = 1;
	while(exp>0){
		if(exp%2==1) res = ((res%M)*(base%M))%M;
		base = ((base%M)*(base%M))%M;
		exp/=2;
	}
	return res%M;
}
const int INF = INT_MAX;
const ll INFL = LLONG_MAX;
int main(){
	std::ios::sync_with_stdio(0);
	cin.tie(0);
	int n,m,k,z;
	cin>>n>>m>>k;
	vector < int > A,B;
	rep(i,n){
		cin>>z;
		A.pb(z);
	}
	rep(j,m){
		cin>>z;
		B.pb(z);
	}
	if(A.size()>B.size()){
		cout<<"YES"<<endl;
		return 0;
	}
	sort(all(A));
	sort(all(B));
	reverse(all(A));
	reverse(all(B));
	rep(i,A.size()){
		if(A[i]>B[i]){
			cout<<"YES"<<endl;
			return 0;
		}
	}
	cout<<"NO"<<endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int (i) = 0; (i) < (n); (i) ++)
#define rep1(i, n) for (int (i) = 1; (i) <= (n); (i) ++)
#define FOR(i, a, b) for (int (i) = (a); (i) <= (b); (i) ++)
#define ROF(i, a, b) for (int (i) = (a); (i) >= (b); (i) --)

#define endl '\n'
#define all(x) x.begin(),x.end()
#define mp make_pair
#define ll long long
#define ld long double
#define pb push_back

#define M 1000000007

#define pi 3.1415926535897932384626433832795028
#define F first
#define S second
int gcd(int a,int b){
	while (a&&b)a>b?a%=b:b%=a;
	return a+b;
}
ll lcm(ll a, ll b){
	return (a*b)/gcd(a,b);
}
ll fast_exp(ll base, ll exp){
	ll res = 1;
	while(exp>0){
		if(exp%2==1) res = ((res%M)*(base%M))%M;
		base = ((base%M)*(base%M))%M;
		exp/=2;
	}
	return res%M;
}
const int INF = INT_MAX;
const ll INFL = LLONG_MAX;
map < int , int > cnt,wt;
int main(){
	std::ios::sync_with_stdio(0);
	cin.tie(0);
	int n,m,k;
	cin>>n>>m>>k;
	vector < int > A,B;
	rep(i,n){
		cin>>k;
		A.pb(k);
		cnt[k]++;
	}
	rep(i,m){
		cin>>k;
		B.pb(k);
		cnt[k]--;
	}
	vector < int > n1,n2;
	rep(i,A.size()){
		int z = cnt[A[i]];
		while(z>0){
			n1.pb(A[i]);
			z--;
		}
	}
	rep(i,B.size()){
		int z = cnt[B[i]];
		while(z<0){
			n2.pb(B[i]);
			z++;
		}
	}
	sort(all(n1));
	sort(all(n2));
	int i = 0,j=0,ans=0;
	int p1 = n1.size(),p2 = n2.size();
	int prev=0;
	int ct = 0;
	while(i<n1.size() && j<n2.size()){
		if(n1[i]<n2[j]){
			wt[n1[i]] = prev;
			i++;
			ct++;
		}
		else{
			wt[n2[j]] = prev;
			prev++;
			if(i!=n1.size())
			wt[n1[i]]=prev*ct;
			ct=0;
			j++;
		}
	}
	if(j==n2.size() && i!=n1.size()){
		cout<<"YES"<<endl;
		return 0;
	}
	ll sum1=0,sum2=0;
	rep(i,n1.size()){
		sum1 += wt[n1[i]];
	}
	rep(i,n2.size()){
		sum2 += wt[n2[i]];
	}
	if(sum1>sum2){
		cout<<"YES"<<endl;
	}
	else cout<<"NO"<<endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int (i) = 0; (i) < (n); (i) ++)
#define rep1(i, n) for (int (i) = 1; (i) <= (n); (i) ++)
#define FOR(i, a, b) for (int (i) = (a); (i) <= (b); (i) ++)
#define ROF(i, a, b) for (int (i) = (a); (i) >= (b); (i) --)

#define endl '\n'
#define all(x) x.begin(),x.end()
#define mp make_pair
#define ll long long
#define ld long double
#define pb push_back

#define M 1000000007

#define pi 3.1415926535897932384626433832795028
#define F first
#define S second
int gcd(int a,int b){
	while (a&&b)a>b?a%=b:b%=a;
	return a+b;
}
ll lcm(ll a, ll b){
	return (a*b)/gcd(a,b);
}
ll fast_exp(ll base, ll exp){
	ll res = 1;
	while(exp>0){
		if(exp%2==1) res = ((res%M)*(base%M))%M;
		base = ((base%M)*(base%M))%M;
		exp/=2;
	}
	return res%M;
}
const int INF = INT_MAX;
const ll INFL = LLONG_MAX;
map < int , int > cnt;
int main(){
	std::ios::sync_with_stdio(0);
	cin.tie(0);
	int n,m,k;
	cin>>n>>m>>k;
	vector < int > A,B;
	rep(i,n){
		cin>>k;
		A.pb(k);
		cnt[k]++;
	}
	rep(i,m){
		cin>>k;
		B.pb(k);
		cnt[k]--;
	}
	vector < int > n1,n2;
	rep(i,A.size()){
		int z = cnt[A[i]];
		while(z>0){
			n1.pb(A[i]);
			z--;
		}
	}
	rep(i,B.size()){
		int z = cnt[B[i]];
		while(z<0){
			n2.pb(B[i]);
			z++;
		}
	}
	sort(all(n1));
	sort(all(n2));
	int i = 0,j=0,ans=0;
	int p1 = n1.size(),p2 = n2.size();
	while(i<n1.size() && j<n2.size()){
		if(n1[i]>n2[j])
			break;
		else i++;
	}
	if(i==n1.size()){
		cout<<"NO"<<endl;
	}
	else cout<<"YES"<<endl;
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int (i) = 0; (i) < (n); (i) ++)
#define rep1(i, n) for (int (i) = 1; (i) <= (n); (i) ++)
#define FOR(i, a, b) for (int (i) = (a); (i) <= (b); (i) ++)
#define ROF(i, a, b) for (int (i) = (a); (i) >= (b); (i) --)

#define endl '\n'
#define all(x) x.begin(),x.end()
#define mp make_pair
#define ll long long
#define ld long double
#define pb push_back

#define M 1000000007

#define pi 3.1415926535897932384626433832795028
#define F first
#define S second
int gcd(int a,int b){
	while (a&&b)a>b?a%=b:b%=a;
	return a+b;
}
ll lcm(ll a, ll b){
	return (a*b)/gcd(a,b);
}
ll fast_exp(ll base, ll exp){
	ll res = 1;
	while(exp>0){
		if(exp%2==1) res = ((res%M)*(base%M))%M;
		base = ((base%M)*(base%M))%M;
		exp/=2;
	}
	return res%M;
}
const int INF = INT_MAX;
const ll INFL = LLONG_MAX;
map < int , int > cnt;
int main(){
	std::ios::sync_with_stdio(0);
	cin.tie(0);
	int n,m,k;
	cin>>n>>m>>k;
	vector < int > A,B;
	rep(i,n){
		cin>>k;
		A.pb(k);
		cnt[k]++;
	}
	rep(i,m){
		cin>>k;
		B.pb(k);
		cnt[k]--;
	}
	if(n>m){
		cout<<"YES"<<endl;
		return 0;
	}
	vector < int > n1,n2;
	rep(i,A.size()){
		int z = cnt[A[i]];
		while(z>0){
			n1.pb(A[i]);
			z--;
		}
	}
	rep(i,B.size()){
		int z = cnt[B[i]];
		while(z<0){
			n2.pb(B[i]);
			z++;
		}
	}
	sort(all(n1));
	sort(all(n2));
	int i = 0,j=0,ans=0;
	int p1 = n1.size(),p2 = n2.size();
	while(i<n1.size() && j<n2.size()){
		if(n1[i]>n2[j])
			break;
		else i++;
	}
	if(i==n1.size()){
		cout<<"NO"<<endl;
	}
	else cout<<"YES"<<endl;
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> PI;
int a[100010],b[100010];
int main(){
	int n,m,k;
	scanf("%d%d%d",&n,&m,&k);
	for(int i=1;i<=n;i++)
		scanf("%d",a+i);
	for(int i=1;i<=m;i++)
		scanf("%d",b+i);
	sort(a+1,a+1+n);
	sort(b+1,b+1+m);
	bool ok=false;
	for(int i=1;i<=n;i++){
		int posB=lower_bound(b+1,b+1+m,a[i])-b;
		int num=m-posB+1;
		if(n-i+1>num) ok=true;
	}
	if(ok) puts("YES");
	else puts("NO");
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> PI;
int a[100010],b[100010];
set<int> dic;
int main(){
	int n,m,k;
	scanf("%d%d%d",&n,&m,&k);
	for(int i=1;i<=n;i++)
		scanf("%d",a+i);
	for(int i=1;i<=m;i++){
		scanf("%d",b+i);
		dic.insert(b[i]);
	}
	bool ok=false;
	for(int i=1;i<=n;i++){
		if(!dic.count(a[i])) ok=true;
	}
	if(ok) puts("YES");
	else puts("NO");
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define N 200010
vector<int> va, vb;
int main(){
    int n, m, k;
    int w;
    scanf("%d%d%d", &n, &m, &k);
    for(int i = 0; i < n; i ++){
        scanf("%d", &w);
        va.push_back(w);
    }
    for(int i = 0; i < m; i ++){
        scanf("%d", &w);
        vb.push_back(w);
    }
    while(!va.empty() && !vb.empty()){
        int a = va[va.size() - 1];
        int b = vb[vb.size() - 1];
        va.pop_back();
        vb.pop_back();
        if(a > b) {puts("YES"); return 0;}
    }
    if(vb.empty()){
        if(!va.empty()) {puts("YES"); return 0;}
        else puts("NO");
    }
    else puts("NO");
}


#include<bits/stdc++.h>
using namespace std;

#define N 100010

int n, m, k, a[N], b[N];

int main() {
	cin>>n>>m>>k;
	for (int i = 1; i <= n; i ++) cin>>a[i];
	for (int i = 1; i <= m; i ++) cin>>b[i];
	sort(a +1 , a + n + 1, greater<int>());
	sort(b + 1, b + m + 1, greater<int>());
	if (n > m) puts("YES");
	else {
		for (int i = 1; i <= n; i ++) if (a[i] > b[i]) {
			puts("YES");
			return 0;
		}
		puts("NO");
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 2;
int a[N] = {},b[N] = {};
int main(){
	int n,m,k;
	scanf("%d %d %d",&n,&m,&k);
	for(int i = 0; i < n; i++)
		scanf("%d",a + i);
	for(int i = 0; i < m; i++)
		scanf("%d",b + i);
	sort(a,a + n);
	sort(b,b + m);
	int flag = 0;
	for(int i = 0; i < n; i++){
		for(int j = 0; j < m; j++){
		if(b[j] >= a[i]) {b[j] = 0; a[i] = 0; break;}}}
	for(int i = 0; i < n; i++)
	if(a[i] > 0) {flag = 1; break;}
	if(flag == 1) puts("YES");
	else puts("NO");
}


#include <bits/stdc++.h>
using namespace std;
#define N 200010
int a[N],  b[N];
vector<int> v, va, vb;
int aa[N], bb[N];
int main(){
    int n, m, k;
    scanf("%d%d%d", &n, &m, &k);
    for(int i = 0; i < n; i ++){
        scanf("%d", &a[i]);
        v.push_back(a[i]);
    }
    for(int  i = 0; i < m; i ++){
        scanf("%d", &b[i]);
        v.push_back(b[i]);
    }
    sort(v.begin(), v.end());
    v.resize(unique(v.begin(), v.end()) - v.begin());
    for(int i = 0; i < n; i ++){
        aa[lower_bound(v.begin(), v.end(), a[i]) - v.begin()] ++;
    }
    for(int i = 0; i < m; i ++){
        bb[lower_bound(v.begin(), v.end(), b[i]) - v.begin()] ++;
    }
    for(int i = 0; i < n + m; i ++){
        if(bb[i] > aa[i]) vb.push_back(i);
        else if(aa[i] > bb[i]) va.push_back(i);
    }
    if(vb.empty()){
        if(va.empty()) puts("NO");
        else puts("YES");
    }
    else{
        bool flag = 0;
        for(int i = 0; i < va.size(); i ++){
            if(va[i] > vb[0]) flag = 1;
        }
        if(flag) puts("YES");
        else puts("NO");
    }

}


#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 2;
int a[N] = {},b[N] = {};
int main(){
    int n,m,k,x;
    scanf("%d %d %d",&n,&m,&k);
    for(int i = 0; i < n; i++){
		scanf("%d",&x);
		a[x]++;}
    for(int i = 0; i < m; i++){
		scanf("%d",&x);
		if(a[x] > 0) a[x]--;
        else b[x]++;}
	for(int i = 0; i < k; i++){
        if(a[i] > 0){
            for(int j = i + 1; j < k; j++){
            if(b[j] > 0){
                if(a[i] > b[j]) a[i] -= b[j], b[j] = 0;
                else b[j] -= a[i], a[i] = 0;}
            if(a[i] == 0) break;}}}
	int flag = 0;
	for(int i = 0; i < k; i++)
		if(a[i] > 0) {flag = 1; break;}
	if(flag == 1) puts("YES");
	else puts("NO");
}


#include <bits/stdc++.h>
using namespace std;
#define N 200010
int a[N],  b[N];
vector<int> v, va, vb;
int aa[N], bb[N];
int main(){
    int n, m, k;
    scanf("%d%d%d", &n, &m, &k);
    for(int i = 0; i < n; i ++){
        scanf("%d", &a[i]);
        v.push_back(a[i]);
    }
    for(int  i = 0; i < m; i ++){
        scanf("%d", &b[i]);
        v.push_back(b[i]);
    }
    if(n > m) {puts("YES"); return 0;}
    sort(v.begin(), v.end());
    v.resize(unique(v.begin(), v.end()) - v.begin());
    for(int i = 0; i < n; i ++){
        aa[lower_bound(v.begin(), v.end(), a[i]) - v.begin()] ++;
    }
    for(int i = 0; i < m; i ++){
        bb[lower_bound(v.begin(), v.end(), b[i]) - v.begin()] ++;
    }
    for(int i = 0; i < v.size(); i ++){
        if(bb[i] > aa[i]) vb.push_back(i);
        else if(aa[i] > bb[i]) va.push_back(i);
    }
    if(vb.empty()){
        if(va.empty()) puts("NO");
        else puts("YES");
    }
    else{
        bool flag = 0;
        for(int i = 0; i < va.size(); i ++){
            if(va[i] > vb[0]) flag = 1;
        }
        if(flag) puts("YES");
        else puts("NO");
    }
}


#include <bits/stdc++.h>

using namespace std;

vector < int > a,b;

int main() {
	int n, m , k,t, aa, bb;
	scanf("%d%d%d", &n, &m, &k);
	for(int i = 0; i < n ; i ++)
		scanf("%d", &t), a.push_back(t);
	for(int i = 0; i < m; i ++)
		scanf("%d", &t), b.push_back(t);
	sort(a.begin(), a.end());
	sort(b.begin(), b.end());
	while(1){
		aa = a[a.size() - 1];
		bb = b[b.size() - 1];
		a.pop_back();b.pop_back();
		if(aa > bb){cout << "YES"; return 0;}
		if(a.empty() || b.empty()){
			if(!a.empty()){cout << "YES";return 0;}
			break;
		}
	}
	cout << "NO";
}


#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 2;
int a[N] = {},b[N] = {};
int main(){
	int n,m,k;
	scanf("%d %d %d",&n,&m,&k);
	for(int i = 0; i < n; i++)
		scanf("%d",a + i);
	for(int i = 0; i < m; i++)
		scanf("%d",b + i);
	sort(a,a + n);
	sort(b,b + m);
	int flag = 0,flag1 = 0;
	int id = 0;
	for(int i = 0; i < n; i++){
		for(int j = id; j < m; j++){
		if(b[j] >= a[i]) {
			if(j == m) flag1 = 1;
			b[j] = 0; a[i] = 0; id = j + 1; break;}}
		if(flag1 == 1) break;}
	for(int i = 0; i < n; i++)
	if(a[i] > 0) {flag = 1; break;}
	if(flag == 1) puts("YES");
	else puts("NO");
}


#include <bits/stdc++.h>
using namespace std;

#define N 100010

int n, m, k, a[N], b[N];

bool solve() {
    if (n > m) return 1;
    sort(a, a + n, greater <int> () );
    sort(b, b + m, greater <int> () );
    for (int i = 0; i < n; i ++) if (a[i] > b[i]) return 1;
    return 0;
}

int main() {
    scanf("%d %d %d", &n, &m, &k);
    for (int i = 0; i < n; i ++) scanf("%d", &a[i]);
    for (int i = 0; i < m; i ++) scanf("%d", &b[i]);
    puts(solve() ? "YES" : "NO");

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 2;
int a[N] = {},b[N] = {};
int main(){
    int n,m,k,x;
    scanf("%d %d %d",&n,&m,&k);
    for(int i = 0; i < n; i++){
		scanf("%d",&x);
		a[x]++;}
    for(int i = 0; i < m; i++){
		scanf("%d",&x);
		if(a[x] > 0) a[x]--;
        else b[x]++;}
	for(int i = 0; i < k; i++){
        if(a[i] > 0){
            for(int j = i + 1; j < k; j++){
            if(b[j] > 0){
                if(a[i] > b[j]) a[i] -= b[j], b[j] = 0;
                else b[j] -= a[i], a[i] = 0;}
            if(a[i] == 0) break;}}}
	int flag = 0;
	for(int i = 0; i < n; i++)
		if(a[i] > 0) {flag = 1; break;}
	if(flag == 1) puts("YES");
	else puts("NO");
}


#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 2;
int a[N] = {},b[N] = {},c[N] = {},d[N] = {};
int main(){
	int n,m,k;
	scanf("%d %d %d",&n,&m,&k);
	for(int i = 0; i < n; i++)
		scanf("%d",&a[i]);
	for(int i = 0; i < m; i++)
		scanf("%d",&b[i]);
	for(int i = 0; i < k; i++){
		if(a[i] > b[i]) c[i] = a[i] - b[i];
		else d[i] = b[i] - a[i];}
	for(int i = 0; i < k; i++){
		if(c[i] > 0){
			for(int j = i + 1; j < k; j++){
			if(d[j] > 0){
				if(c[i] > d[j]) c[i] -= d[j], d[j] = 0;
				else d[j] -= c[i], c[i] = 0;}
			if(c[i] == 0) break;}}}
			int flag = 0;
	for(int i = 0; i < k; i++){
		if(d[i] > 0) {printf("NO\n"); flag = 1; break;}}
		if(flag == 0) printf("YES\n");
}


#include <bits/stdc++.h>
using namespace std;
#define N 200010
int a[N],  b[N];
vector<int> v, va, vb;
int aa[N], bb[N];
int main(){
    int n, m, k;
    scanf("%d%d%d", &n, &m, &k);
    for(int i = 0; i < n; i ++){
        scanf("%d", &a[i]);
        v.push_back(a[i]);
    }
    for(int  i = 0; i < m; i ++){
        scanf("%d", &b[i]);
        v.push_back(b[i]);
    }
    sort(v.begin(), v.end());
    v.resize(unique(v.begin(), v.end()) - v.begin());
    for(int i = 0; i < n; i ++){
        aa[lower_bound(v.begin(), v.end(), a[i]) - v.begin()] ++;
    }
    for(int i = 0; i < m; i ++){
        bb[lower_bound(v.begin(), v.end(), b[i]) - v.begin()] ++;
    }
    for(int i = 0; i < v.size(); i ++){
        if(bb[i] > aa[i]) vb.push_back(i);
        else if(aa[i] > bb[i]) va.push_back(i);
    }
    if(vb.empty()){
        if(va.empty()) puts("NO");
        else puts("YES");
    }
    else{
        bool flag = 0;
        for(int i = 0; i < va.size(); i ++){
            if(va[i] > vb[0]) flag = 1;
        }
        if(va.size() > vb.size()) flag = 1;
        if(flag) puts("YES");
        else puts("NO");
    }
}


#include <bits/stdc++.h>
using namespace std;
#define N 200010
vector<int> va, vb;
int main(){
    int n, m, k;
    int w;
    scanf("%d%d%d", &n, &m, &k);
    for(int i = 0; i < n; i ++){
        scanf("%d", &w);
        va.push_back(w);
    }
    for(int i = 0; i < m; i ++){
        scanf("%d", &w);
        vb.push_back(b);
    }
    while(!va.empty() && !vb.empty()){
        int a = va[va.size() - 1];
        int b = vb[vb.size() - 1];
        va.pop_back();
        vb.pop_back();
        if(a > b) {puts("YES"); return 0;}
    }
    if(vb.empty()){
        if(!va.empty()) {puts("YES"); return 0;}
        else puts("NO");
    }
    else puts("NO");
}


#include<stdio.h>
#include<algorithm>
#define M 100001
using namespace std;
int main(){
    int n, m, k;
    scanf("%d%d%d", &n, &m, &k);
    int a[n], b[m];
    for(int i = 0; i < n; i ++)
        scanf("%d", &a[i]);
    for(int j = 0; j < m; j ++)
        scanf("%d", &b[j]);
    sort(a, a + n), sort(b, b + m);
    int p = m - 1, flag = 0;
    for(int i = n - 1; i >= 0; i --){
        if(a[i] <= b[p]) p --;
        else {flag = 1; break;}
    }
    if(flag) printf("YES\n");
    else printf("NO\n");
}


n, m, k = map(int, input().split())

a = input().split()
b = input().split()

a.sort(reverse=True)
b.sort(reverse=True)

ans = 'NO'

if n > m:
    ans = 'YES'
else:
    for i in range(n):
        if a[i] > b[i]:
            ans = 'YES'

print(ans)


#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 2;
int a[N] = {},b[N] = {};
int main(){
	int n,m,k;
	scanf("%d %d %d",&n,&m,&k);
	for(int i = 0; i < n; i++)
		scanf("%d",a + i);
	for(int i = 0; i < m; i++)
		scanf("%d",b + i);
	sort(a,a + n);
	sort(b,b + m);
	int flag = 0;
	for(int i = 0; i < n; i++){
		for(int j = 0; j < m; j++){
		if(b[j] > a[i]) {b[j] = 0; a[i] = 0; break;}}}
	for(int i = 0; i < n; i++)
	if(a[i] > 0) {flag = 1; break;}
	if(flag == 1) puts("YES");
	else puts("NO");
}


#include <bits/stdc++.h>
using namespace std;
#define N 200010
vector<int> va, vb;
int main(){
    int n, m, k;
    int w;
    scanf("%d%d%d", &n, &m, &k);
    for(int i = 0; i < n; i ++){
        scanf("%d", &w);
        va.push_back(w);
    }
    for(int i = 0; i < m; i ++){
        scanf("%d", &w);
        vb.push_back(w);
    }
    sort(va.begin(), va.end());
    sort(vb.begin(), vb.end());
    while(!va.empty() && !vb.empty()){
        int a = va[va.size() - 1];
        int b = vb[vb.size() - 1];
        va.pop_back();
        vb.pop_back();
        if(a > b) {puts("YES"); return 0;}
    }
    if(vb.empty()){
        if(!va.empty()) {puts("YES"); return 0;}
        else puts("NO");
    }
    else puts("NO");
}


#include <bits/stdc++.h>
using namespace std;

using ll = long long;

#define N 100005

int n, m, k;

vector <int> A, B;

int main() {
	scanf("%d %d %d", &n, &m, &k);
    for (int i = 1, x; i <= n; i ++) {
        scanf("%d", &x);
		A.push_back(x);
    }
    for (int i = 1, x; i <= m; i ++) {
		scanf("%d", &x);
        B.push_back(x);
    }
    sort(A.begin(), A.end());
    sort(B.begin(), B.end());
    reverse(A.begin(), A.end());
    reverse(B.begin(), B.end());
    int sa = A.size(), sb = B.size();
    int sz = min(sa, sb);
    bool flag = 0;
    for (int i = 0; i < sz; i ++) {
        if (A[i] > B[i]) flag = 1;
    }
    if (flag) {
        puts("YES");
        return 0;
    }
    if (sa > sb) puts("YES");
    else puts("NO");

	return 0;
}


#include<bits/stdc++.h>
using namespace std;

int main() {
    ios::sync_with_stdio(0); cin.tie(0);
    int n, m, k;
    cin >> n >> m >> k;
    vector <int> a(n), b(m);
    for(int i = 0; i < n; i ++) cin >> a[i];
    for(int i = 0; i < m; i ++) cin >> b[i];
    vector <int> c(n+m);
    for(int i = 0; i < n; i ++) c[i] = a[i];
    for(int i = 0; i < m; i ++) c[n+i] = b[i];
    sort(c.begin(), c.end());
    c.erase(unique(c.begin(), c.end()), c.end());
    for(int i = 0; i < n; i ++) a[i] = lower_bound(c.begin(), c.end(), a[i]) - c.begin();
    for(int i = 0; i < m; i ++) b[i] = lower_bound(c.begin(), c.end(), b[i]) - c.begin();
    int t = c.size();
    vector <int> x(t), y(t);
    for(int i = 0; i < n; i ++) x[a[i]] ++;
    for(int i = 0; i < m; i ++) y[b[i]] ++;
    for(int i = t-1; i > 0; i --) x[i-1] += x[i], y[i-1] += y[i];
    for(int i = t-1; i >= 0; i --) {
        if(x[i] > y[i]) {
            puts("YES");
            return 0;
        }
    }
    puts("NO");
}


#include<bits/stdc++.h>
using namespace std;
int n,m,k,x,ps;
map<int,int> mp;
int main()
{
	cin>>n>>m>>k;
	for (int i=0;i<n;i++) cin>>x,mp[-x]++;
	for (int i=0;i<m;i++) cin>>x,mp[-x]--;
	for (typeof(mp.begin())it=mp.begin();it!=mp.end();it++)
	{
		ps+=it->second;
		if (ps>0)
		{
			cout<<"YES";
			return 0;
		}
	}
	cout<<"NO";
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n,m,k,t,shit;
map<int,int> mp;
int main(){

	cin>>n>>m>>k;
	for (int i=1;i<=n;i++) cin>>t,++mp[-t];
	for (int i=1;i<=m;i++) cin>>t,--mp[-t];
	for (map<int,int>::iterator it=mp.begin();it!=mp.end();it++)
	{
		shit+=it->second;
		if (shit>0)
		{
			cout<<"YES";
			return 0;
		}
	}
	cout<<"NO";
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n,m,k,x;
bool ok;
int main()
{
	cin>>n>>m>>k;
	if (n>m)
	{
		cout<<"YES";
		return 0;
	}
	vector<int> a(n),b(m);
	for (int i=0;i<n;i++) cin>>a[i];
	for (int i=0;i<m;i++) cin>>b[i];
	sort(a.begin(),a.end(),greater<int>());
	sort(b.begin(),b.end(),greater<int>());
	for (int i=0;i<n;i++) if (a[i]>b[i]) ok=true;
	if (ok) cout<<"YES";
	else cout<<"NO";
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
#define rep(i,a,b) for(int i=a;i<=b;++i)
#define rev(i,a,b) for(int i=a;i>=b;i--)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define si set<int>
#define sll set<ll>
#define vi vector<int>
#define vll vector<ll>
#define vpii vector<pii>
#define vpll vector<pll>
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define ln length()
#define M 1000000007
#define endl '\n'
#define FIO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
int n,m,k;
vpii fs;
vi ltc,lt,rtc,rt;
int main(){
    FIO;
    cin>>n>>m>>k;
    rep(i,1,n){
        int x;cin>>x;
        fs.pb(mp(x,1));
    }
    rep(i,1,m){
        int x;cin>>x;
        fs.pb(mp(x,2));
    }
    sort(fs.begin(),fs.end());
    fs.pb(mp(0,0));
    int st=1;
    rep(i,0,fs.size()-2){
        while(fs[i].F==fs[i+1].F) fs[i].F=st,i++;
        fs[i].F=st;
        st++;
    }
    rep(i,0,fs.size()-2){
        int cl=0,cr=0;
        while(fs[i].F==fs[i+1].F){
            if(fs[i].S==1) cl++;
            else cr++;
            i++;
        }
        if(fs[i].S==1) cl++;
        else cr++;
        if(cl>cr){
            ltc.pb(cl-cr);
            lt.pb(fs[i].F);
        }
        if(cr>cl){
            rtc.pb(cr-cl);
            rt.pb(fs[i].F);
        }
    }
    if(lt.size()==0){
        cout<<"NO";
        return 0;
    }

    if(rt.size()==0){
        cout<<"YES";
        return 0;
    }
    int p1=lt.size()-1,p2=rt.size()-1;
    while(1){
        if(lt[p1]>rt[p2]){
            cout<<"YES";
            return 0;
        }
        int ct=0;
        while(p2>=0&&rt[p2]>lt[p1]) ct+=rtc[p2],p2--;
        if(ct<ltc[p1]){
            cout<<"YES";
            return 0;
        }
        else if(ct==ltc[p1]){
            p1--;
            if(p1==-1){
                cout<<"NO";
                return 0;
            }
            if(p2==-1){
                cout<<"YES";
                return 0;
            }
        }
        else{
            p1--;
            if(p1==-1){
                cout<<"NO";
                return 0;
            }
            p2++;
            rt[p2]=lt[p1+1];
            rtc[p2]=ct-ltc[p1+1];
        }
    }
}


#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
#define rep(i,a,b) for(int i=a;i<=b;++i)
#define rev(i,a,b) for(int i=a;i>=b;i--)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define si set<int>
#define sll set<ll>
#define vi vector<int>
#define vll vector<ll>
#define vpii vector<pii>
#define vpll vector<pll>
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define ln length()
#define M 1000000007
#define endl '\n'
#define FIO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
int n,m,k;
vpii fs;
vi ltc,lt,rtc,rt;
int main(){
    FIO;
    cin>>n>>m>>k;
    rep(i,1,n){
        int x;cin>>x;
        fs.pb(mp(x,1));
    }
    rep(i,1,m){
        int x;cin>>x;
        fs.pb(mp(x,2));
    }
    sort(fs.begin(),fs.end());
    fs.pb(mp(0,0));
    rep(i,0,fs.size()-2){
        int cl=0,cr=0;
        while(fs[i].F==fs[i+1].F){
            if(fs[i].S==1) cl++;
            else cr++;
            i++;
        }
        if(fs[i].S==1) cl++;
        else cr++;
        if(cl>cr){
            ltc.pb(cl-cr);
            lt.pb(fs[i].F);
        }
        if(cr>cl){
            rtc.pb(cr-cl);
            rt.pb(fs[i].F);
        }
    }
    if(lt.size()==0){
        cout<<"NO";
        return 0;
    }

    if(rt.size()==0){
        cout<<"YES";
        return 0;
    }
    int p1=lt.size()-1,p2=rt.size()-1;
    while(1){
        if(lt[p1]>rt[p2]){
            cout<<"YES";
            return 0;
        }
        int ct=0;
        while(p2>=0&&rt[p2]>lt[p1]) ct+=rtc[p2],p2--;
        if(ct<ltc[p1]){
            cout<<"YES";
            return 0;
        }
        else if(ct==ltc[p1]){
            p1--;
            if(p1==-1){
                cout<<"NO";
                return 0;
            }
            if(p2==-1){
                cout<<"YES";
                return 0;
            }
        }
        else{
            p1--;
            if(p1==-1){
                cout<<"NO";
                return 0;
            }
            p2++;
            rt[p2]=lt[p1+1];
            rtc[p2]=ct-ltc[p1+1];
        }
    }
}