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> H = new ArrayList<>();
		for(int i=0;i<N;i++) {
			H.add(scan.nextInt());
		}
		scan.close();

		int min = 100;
		int result = 0;

		for(int i=-100;i<=101;i++) {
			if(!H.contains(i)) {
				int tmp2 = X-i;
				if(tmp2<0) {
					tmp2 = i-X;
				}
				if(tmp2<min) {
					min = tmp2;
					result = i;
				}
			}
		}
		System.out.println(result);
	}
} 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> H = new ArrayList<>();
		for(int i=0;i<N;i++) {
			H.add(scan.nextInt());
		}
		scan.close();

		int min = 100;
		int result = 0;

		for(int i=-100;i<=101;i++) {
			if(!H.contains(i)) {
				int tmp2 = X-i;
				if(tmp2<0) {
					tmp2 = i-X;
				}
				if(tmp2<min) {
					min = tmp2;
					result = i;
				}
			}
		}
		System.out.println(result);
	}
} Main public static void main(String args[]){
		Scanner scan = new Scanner(System.in);
		int X = scan.nextInt();
		int N = scan.nextInt();
		ArrayList<Integer> H = new ArrayList<>();
		for(int i=0;i<N;i++) {
			H.add(scan.nextInt());
		}
		scan.close();

		int min = 100;
		int result = 0;

		for(int i=-100;i<=101;i++) {
			if(!H.contains(i)) {
				int tmp2 = X-i;
				if(tmp2<0) {
					tmp2 = i-X;
				}
				if(tmp2<min) {
					min = tmp2;
					result = i;
				}
			}
		}
		System.out.println(result);
	} main {
		Scanner scan = new Scanner(System.in);
		int X = scan.nextInt();
		int N = scan.nextInt();
		ArrayList<Integer> H = new ArrayList<>();
		for(int i=0;i<N;i++) {
			H.add(scan.nextInt());
		}
		scan.close();

		int min = 100;
		int result = 0;

		for(int i=-100;i<=101;i++) {
			if(!H.contains(i)) {
				int tmp2 = X-i;
				if(tmp2<0) {
					tmp2 = i-X;
				}
				if(tmp2<min) {
					min = tmp2;
					result = i;
				}
			}
		}
		System.out.println(result);
	} 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> H = new ArrayList<>(); H new ArrayList<>() for(int i=0;i<N;i++) {
			H.add(scan.nextInt());
		} int i=0; int i=0; i 0 i<N i N i++ i++ i {
			H.add(scan.nextInt());
		} {
			H.add(scan.nextInt());
		} H.add(scan.nextInt()) H.add H scan.nextInt() scan.nextInt scan scan.close() scan.close scan int min = 100; min 100 int result = 0; result 0 for(int i=-100;i<=101;i++) {
			if(!H.contains(i)) {
				int tmp2 = X-i;
				if(tmp2<0) {
					tmp2 = i-X;
				}
				if(tmp2<min) {
					min = tmp2;
					result = i;
				}
			}
		} int i=-100; int i=-100; i -100 100 i<=101 i 101 i++ i++ i {
			if(!H.contains(i)) {
				int tmp2 = X-i;
				if(tmp2<0) {
					tmp2 = i-X;
				}
				if(tmp2<min) {
					min = tmp2;
					result = i;
				}
			}
		} {
			if(!H.contains(i)) {
				int tmp2 = X-i;
				if(tmp2<0) {
					tmp2 = i-X;
				}
				if(tmp2<min) {
					min = tmp2;
					result = i;
				}
			}
		} if(!H.contains(i)) {
				int tmp2 = X-i;
				if(tmp2<0) {
					tmp2 = i-X;
				}
				if(tmp2<min) {
					min = tmp2;
					result = i;
				}
			} !H.contains(i) H.contains(i) H.contains H i {
				int tmp2 = X-i;
				if(tmp2<0) {
					tmp2 = i-X;
				}
				if(tmp2<min) {
					min = tmp2;
					result = i;
				}
			} int tmp2 = X-i; tmp2 X-i X i if(tmp2<0) {
					tmp2 = i-X;
				} tmp2<0 tmp2 0 {
					tmp2 = i-X;
				} tmp2 = i-X tmp2 i-X i X if(tmp2<min) {
					min = tmp2;
					result = i;
				} tmp2<min tmp2 min {
					min = tmp2;
					result = i;
				} min = tmp2 min tmp2 result = i result i System.out.println(result) System.out.println System.out System System.out result 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> H = new ArrayList<>();
		for(int i=0;i<N;i++) {
			H.add(scan.nextInt());
		}
		scan.close();

		int min = 100;
		int result = 0;

		for(int i=-100;i<=101;i++) {
			if(!H.contains(i)) {
				int tmp2 = X-i;
				if(tmp2<0) {
					tmp2 = i-X;
				}
				if(tmp2<min) {
					min = tmp2;
					result = i;
				}
			}
		}
		System.out.println(result);
	}
} 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> H = new ArrayList<>();
		for(int i=0;i<N;i++) {
			H.add(scan.nextInt());
		}
		scan.close();

		int min = 100;
		int result = 0;

		for(int i=-100;i<=101;i++) {
			if(!H.contains(i)) {
				int tmp2 = X-i;
				if(tmp2<0) {
					tmp2 = i-X;
				}
				if(tmp2<min) {
					min = tmp2;
					result = i;
				}
			}
		}
		System.out.println(result);
	}
} 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> H = new ArrayList<>();
		for(int i=0;i<N;i++) {
			H.add(scan.nextInt());
		}
		scan.close();

		int min = 100;
		int result = 0;

		for(int i=-100;i<=101;i++) {
			if(!H.contains(i)) {
				int tmp2 = X-i;
				if(tmp2<0) {
					tmp2 = i-X;
				}
				if(tmp2<min) {
					min = tmp2;
					result = i;
				}
			}
		}
		System.out.println(result);
	}
}
