import java.util.ArrayList;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);

		int x = scan.nextInt();
		int n = scan.nextInt();
		ArrayList<Integer> list = new ArrayList<Integer>();
		int abs = 99;
		int ans = 100;

		for(int i = 0;i < n;i++) {
			list.add(scan.nextInt());
		}

		for(int i = 0;i <= 200;i++) {
			if(!(list.contains(i))) {
				if(Math.abs(x - i) < abs) {
					abs = Math.abs(x - i);
					ans = i;
				}
			}
		}

		if(n == 0 || !(list.contains(x))) {
			System.out.println(x);
		}else {
			System.out.println(ans);
		}
	}
} import java.util.ArrayList; ArrayList java.util import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);

		int x = scan.nextInt();
		int n = scan.nextInt();
		ArrayList<Integer> list = new ArrayList<Integer>();
		int abs = 99;
		int ans = 100;

		for(int i = 0;i < n;i++) {
			list.add(scan.nextInt());
		}

		for(int i = 0;i <= 200;i++) {
			if(!(list.contains(i))) {
				if(Math.abs(x - i) < abs) {
					abs = Math.abs(x - i);
					ans = i;
				}
			}
		}

		if(n == 0 || !(list.contains(x))) {
			System.out.println(x);
		}else {
			System.out.println(ans);
		}
	}
} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);

		int x = scan.nextInt();
		int n = scan.nextInt();
		ArrayList<Integer> list = new ArrayList<Integer>();
		int abs = 99;
		int ans = 100;

		for(int i = 0;i < n;i++) {
			list.add(scan.nextInt());
		}

		for(int i = 0;i <= 200;i++) {
			if(!(list.contains(i))) {
				if(Math.abs(x - i) < abs) {
					abs = Math.abs(x - i);
					ans = i;
				}
			}
		}

		if(n == 0 || !(list.contains(x))) {
			System.out.println(x);
		}else {
			System.out.println(ans);
		}
	} main {
		Scanner scan = new Scanner(System.in);

		int x = scan.nextInt();
		int n = scan.nextInt();
		ArrayList<Integer> list = new ArrayList<Integer>();
		int abs = 99;
		int ans = 100;

		for(int i = 0;i < n;i++) {
			list.add(scan.nextInt());
		}

		for(int i = 0;i <= 200;i++) {
			if(!(list.contains(i))) {
				if(Math.abs(x - i) < abs) {
					abs = Math.abs(x - i);
					ans = i;
				}
			}
		}

		if(n == 0 || !(list.contains(x))) {
			System.out.println(x);
		}else {
			System.out.println(ans);
		}
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int x = scan.nextInt(); x scan.nextInt() scan.nextInt scan int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan ArrayList<Integer> list = new ArrayList<Integer>(); list new ArrayList<Integer>() int abs = 99; abs 99 int ans = 100; ans 100 for(int i = 0;i < n;i++) {
			list.add(scan.nextInt());
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			list.add(scan.nextInt());
		} {
			list.add(scan.nextInt());
		} list.add(scan.nextInt()) list.add list scan.nextInt() scan.nextInt scan for(int i = 0;i <= 200;i++) {
			if(!(list.contains(i))) {
				if(Math.abs(x - i) < abs) {
					abs = Math.abs(x - i);
					ans = i;
				}
			}
		} int i = 0; int i = 0; i 0 i <= 200 i 200 i++ i++ i {
			if(!(list.contains(i))) {
				if(Math.abs(x - i) < abs) {
					abs = Math.abs(x - i);
					ans = i;
				}
			}
		} {
			if(!(list.contains(i))) {
				if(Math.abs(x - i) < abs) {
					abs = Math.abs(x - i);
					ans = i;
				}
			}
		} if(!(list.contains(i))) {
				if(Math.abs(x - i) < abs) {
					abs = Math.abs(x - i);
					ans = i;
				}
			} !(list.contains(i)) (list.contains(i)) list.contains list i {
				if(Math.abs(x - i) < abs) {
					abs = Math.abs(x - i);
					ans = i;
				}
			} if(Math.abs(x - i) < abs) {
					abs = Math.abs(x - i);
					ans = i;
				} Math.abs(x - i) < abs Math.abs(x - i) Math.abs Math x - i x i abs {
					abs = Math.abs(x - i);
					ans = i;
				} abs = Math.abs(x - i) abs Math.abs(x - i) Math.abs Math x - i x i ans = i ans i if(n == 0 || !(list.contains(x))) {
			System.out.println(x);
		}else {
			System.out.println(ans);
		} n == 0 || !(list.contains(x)) n == 0 n 0 !(list.contains(x)) (list.contains(x)) list.contains list x {
			System.out.println(x);
		} System.out.println(x) System.out.println System.out System System.out x {
			System.out.println(ans);
		} System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);

		int x = scan.nextInt();
		int n = scan.nextInt();
		ArrayList<Integer> list = new ArrayList<Integer>();
		int abs = 99;
		int ans = 100;

		for(int i = 0;i < n;i++) {
			list.add(scan.nextInt());
		}

		for(int i = 0;i <= 200;i++) {
			if(!(list.contains(i))) {
				if(Math.abs(x - i) < abs) {
					abs = Math.abs(x - i);
					ans = i;
				}
			}
		}

		if(n == 0 || !(list.contains(x))) {
			System.out.println(x);
		}else {
			System.out.println(ans);
		}
	}
} public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);

		int x = scan.nextInt();
		int n = scan.nextInt();
		ArrayList<Integer> list = new ArrayList<Integer>();
		int abs = 99;
		int ans = 100;

		for(int i = 0;i < n;i++) {
			list.add(scan.nextInt());
		}

		for(int i = 0;i <= 200;i++) {
			if(!(list.contains(i))) {
				if(Math.abs(x - i) < abs) {
					abs = Math.abs(x - i);
					ans = i;
				}
			}
		}

		if(n == 0 || !(list.contains(x))) {
			System.out.println(x);
		}else {
			System.out.println(ans);
		}
	}
} Main
import java.util.ArrayList;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);

		int x = scan.nextInt();
		int n = scan.nextInt();
		ArrayList<Integer> list = new ArrayList<Integer>();
		int abs = 99;
		int ans = 100;

		for(int i = 0;i < n;i++) {
			list.add(scan.nextInt());
		}

		for(int i = 0;i <= 200;i++) {
			if(!(list.contains(i))) {
				if(Math.abs(x - i) < abs) {
					abs = Math.abs(x - i);
					ans = i;
				}
			}
		}

		if(n == 0 || !(list.contains(x))) {
			System.out.println(x);
		}else {
			System.out.println(ans);
		}
	}
}
