import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int X = sc.nextInt(), N = sc.nextInt(), minDiff = X, pNot[] = new int[102], ans = 0;
		for (int i = 0; i <= 101; i++)
			pNot[i] = 1;
		for (int i = 0; i < N; i++)
			pNot[sc.nextInt()] = 0;
		for (int i = 0; i <= 101; i++)
			if (pNot[i] == 1)
				if (minDiff > Math.abs(X - i)) {
					minDiff = Math.abs(X - i);
					ans = i;
				}
		System.out.println(ans);
	}

} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int X = sc.nextInt(), N = sc.nextInt(), minDiff = X, pNot[] = new int[102], ans = 0;
		for (int i = 0; i <= 101; i++)
			pNot[i] = 1;
		for (int i = 0; i < N; i++)
			pNot[sc.nextInt()] = 0;
		for (int i = 0; i <= 101; i++)
			if (pNot[i] == 1)
				if (minDiff > Math.abs(X - i)) {
					minDiff = Math.abs(X - i);
					ans = i;
				}
		System.out.println(ans);
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int X = sc.nextInt(), N = sc.nextInt(), minDiff = X, pNot[] = new int[102], ans = 0;
		for (int i = 0; i <= 101; i++)
			pNot[i] = 1;
		for (int i = 0; i < N; i++)
			pNot[sc.nextInt()] = 0;
		for (int i = 0; i <= 101; i++)
			if (pNot[i] == 1)
				if (minDiff > Math.abs(X - i)) {
					minDiff = Math.abs(X - i);
					ans = i;
				}
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		int X = sc.nextInt(), N = sc.nextInt(), minDiff = X, pNot[] = new int[102], ans = 0;
		for (int i = 0; i <= 101; i++)
			pNot[i] = 1;
		for (int i = 0; i < N; i++)
			pNot[sc.nextInt()] = 0;
		for (int i = 0; i <= 101; i++)
			if (pNot[i] == 1)
				if (minDiff > Math.abs(X - i)) {
					minDiff = Math.abs(X - i);
					ans = i;
				}
		System.out.println(ans);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int X = sc.nextInt() X sc.nextInt() sc.nextInt sc N = sc.nextInt() N sc.nextInt() sc.nextInt sc minDiff = X minDiff X pNot[] = new int[102] pNot new int[102] 102 ans = 0; ans 0 for (int i = 0; i <= 101; i++)
			pNot[i] = 1; int i = 0; int i = 0; i 0 i <= 101 i 101 i++ i++ i pNot[i] = 1; pNot[i] = 1 pNot[i] pNot i 1 for (int i = 0; i < N; i++)
			pNot[sc.nextInt()] = 0; int i = 0; int i = 0; i 0 i < N i N i++ i++ i pNot[sc.nextInt()] = 0; pNot[sc.nextInt()] = 0 pNot[sc.nextInt()] pNot sc.nextInt() sc.nextInt sc 0 for (int i = 0; i <= 101; i++)
			if (pNot[i] == 1)
				if (minDiff > Math.abs(X - i)) {
					minDiff = Math.abs(X - i);
					ans = i;
				} int i = 0; int i = 0; i 0 i <= 101 i 101 i++ i++ i if (pNot[i] == 1)
				if (minDiff > Math.abs(X - i)) {
					minDiff = Math.abs(X - i);
					ans = i;
				} if (pNot[i] == 1)
				if (minDiff > Math.abs(X - i)) {
					minDiff = Math.abs(X - i);
					ans = i;
				} pNot[i] == 1 pNot[i] pNot i 1 if (minDiff > Math.abs(X - i)) {
					minDiff = Math.abs(X - i);
					ans = i;
				} minDiff > Math.abs(X - i) minDiff Math.abs(X - i) Math.abs Math X - i X i {
					minDiff = Math.abs(X - i);
					ans = i;
				} minDiff = Math.abs(X - i) minDiff Math.abs(X - i) Math.abs Math X - i X i ans = i ans i 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 sc = new Scanner(System.in);
		int X = sc.nextInt(), N = sc.nextInt(), minDiff = X, pNot[] = new int[102], ans = 0;
		for (int i = 0; i <= 101; i++)
			pNot[i] = 1;
		for (int i = 0; i < N; i++)
			pNot[sc.nextInt()] = 0;
		for (int i = 0; i <= 101; i++)
			if (pNot[i] == 1)
				if (minDiff > Math.abs(X - i)) {
					minDiff = Math.abs(X - i);
					ans = i;
				}
		System.out.println(ans);
	}

} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int X = sc.nextInt(), N = sc.nextInt(), minDiff = X, pNot[] = new int[102], ans = 0;
		for (int i = 0; i <= 101; i++)
			pNot[i] = 1;
		for (int i = 0; i < N; i++)
			pNot[sc.nextInt()] = 0;
		for (int i = 0; i <= 101; i++)
			if (pNot[i] == 1)
				if (minDiff > Math.abs(X - i)) {
					minDiff = Math.abs(X - i);
					ans = i;
				}
		System.out.println(ans);
	}

} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int X = sc.nextInt(), N = sc.nextInt(), minDiff = X, pNot[] = new int[102], ans = 0;
		for (int i = 0; i <= 101; i++)
			pNot[i] = 1;
		for (int i = 0; i < N; i++)
			pNot[sc.nextInt()] = 0;
		for (int i = 0; i <= 101; i++)
			if (pNot[i] == 1)
				if (minDiff > Math.abs(X - i)) {
					minDiff = Math.abs(X - i);
					ans = i;
				}
		System.out.println(ans);
	}

}
