import java.util.*;
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int X = sc.nextInt();
		int N = sc.nextInt();
		Set<Integer> p = new HashSet<>();
		for(int i = 0; i < N; i++)
			p.add(sc.nextInt());
		int ans = 0, min = Integer.MAX_VALUE/2;
		for(int i = -100; i <= 200; i++)
			if(!p.contains(i) && Math.abs(i-X) < min) {
				ans = i;
				min = Math.abs(i-X);
			}
		System.out.println(ans);
	}

} import java.util.*; util.* java public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int X = sc.nextInt();
		int N = sc.nextInt();
		Set<Integer> p = new HashSet<>();
		for(int i = 0; i < N; i++)
			p.add(sc.nextInt());
		int ans = 0, min = Integer.MAX_VALUE/2;
		for(int i = -100; i <= 200; i++)
			if(!p.contains(i) && Math.abs(i-X) < min) {
				ans = i;
				min = Math.abs(i-X);
			}
		System.out.println(ans);
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int X = sc.nextInt();
		int N = sc.nextInt();
		Set<Integer> p = new HashSet<>();
		for(int i = 0; i < N; i++)
			p.add(sc.nextInt());
		int ans = 0, min = Integer.MAX_VALUE/2;
		for(int i = -100; i <= 200; i++)
			if(!p.contains(i) && Math.abs(i-X) < min) {
				ans = i;
				min = Math.abs(i-X);
			}
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		int X = sc.nextInt();
		int N = sc.nextInt();
		Set<Integer> p = new HashSet<>();
		for(int i = 0; i < N; i++)
			p.add(sc.nextInt());
		int ans = 0, min = Integer.MAX_VALUE/2;
		for(int i = -100; i <= 200; i++)
			if(!p.contains(i) && Math.abs(i-X) < min) {
				ans = i;
				min = Math.abs(i-X);
			}
		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 int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc Set<Integer> p = new HashSet<>(); p new HashSet<>() for(int i = 0; i < N; i++)
			p.add(sc.nextInt()); int i = 0; int i = 0; i 0 i < N i N i++ i++ i p.add(sc.nextInt()); p.add(sc.nextInt()) p.add p sc.nextInt() sc.nextInt sc int ans = 0 ans 0 min = Integer.MAX_VALUE/2; min Integer.MAX_VALUE/2 Integer.MAX_VALUE Integer Integer.MAX_VALUE 2 for(int i = -100; i <= 200; i++)
			if(!p.contains(i) && Math.abs(i-X) < min) {
				ans = i;
				min = Math.abs(i-X);
			} int i = -100; int i = -100; i -100 100 i <= 200 i 200 i++ i++ i if(!p.contains(i) && Math.abs(i-X) < min) {
				ans = i;
				min = Math.abs(i-X);
			} if(!p.contains(i) && Math.abs(i-X) < min) {
				ans = i;
				min = Math.abs(i-X);
			} !p.contains(i) && Math.abs(i-X) < min !p.contains(i) p.contains(i) p.contains p i Math.abs(i-X) < min Math.abs(i-X) Math.abs Math i-X i X min {
				ans = i;
				min = Math.abs(i-X);
			} ans = i ans i min = Math.abs(i-X) min Math.abs(i-X) Math.abs Math i-X i X 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();
		int N = sc.nextInt();
		Set<Integer> p = new HashSet<>();
		for(int i = 0; i < N; i++)
			p.add(sc.nextInt());
		int ans = 0, min = Integer.MAX_VALUE/2;
		for(int i = -100; i <= 200; i++)
			if(!p.contains(i) && Math.abs(i-X) < min) {
				ans = i;
				min = Math.abs(i-X);
			}
		System.out.println(ans);
	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int X = sc.nextInt();
		int N = sc.nextInt();
		Set<Integer> p = new HashSet<>();
		for(int i = 0; i < N; i++)
			p.add(sc.nextInt());
		int ans = 0, min = Integer.MAX_VALUE/2;
		for(int i = -100; i <= 200; i++)
			if(!p.contains(i) && Math.abs(i-X) < min) {
				ans = i;
				min = Math.abs(i-X);
			}
		System.out.println(ans);
	}

} Main
import java.util.*;
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int X = sc.nextInt();
		int N = sc.nextInt();
		Set<Integer> p = new HashSet<>();
		for(int i = 0; i < N; i++)
			p.add(sc.nextInt());
		int ans = 0, min = Integer.MAX_VALUE/2;
		for(int i = -100; i <= 200; i++)
			if(!p.contains(i) && Math.abs(i-X) < min) {
				ans = i;
				min = Math.abs(i-X);
			}
		System.out.println(ans);
	}

}