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

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		int n = sc.nextInt();
		List<Integer>p = new ArrayList<>();
		int a = 0;
		int min = 101;
		for(int i = 0; i < n; i++)
			p.add(sc.nextInt());
		for(int i = -1; i <= 200; i++){
			if(!p.contains(i) && Math.abs(i - x) < min){
				a = i;
				min = Math.abs(i - x);
			}
		}
		System.out.print(a);
	}
} import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util 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();
		int n = sc.nextInt();
		List<Integer>p = new ArrayList<>();
		int a = 0;
		int min = 101;
		for(int i = 0; i < n; i++)
			p.add(sc.nextInt());
		for(int i = -1; i <= 200; i++){
			if(!p.contains(i) && Math.abs(i - x) < min){
				a = i;
				min = Math.abs(i - x);
			}
		}
		System.out.print(a);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		int n = sc.nextInt();
		List<Integer>p = new ArrayList<>();
		int a = 0;
		int min = 101;
		for(int i = 0; i < n; i++)
			p.add(sc.nextInt());
		for(int i = -1; i <= 200; i++){
			if(!p.contains(i) && Math.abs(i - x) < min){
				a = i;
				min = Math.abs(i - x);
			}
		}
		System.out.print(a);
	} main {
		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		int n = sc.nextInt();
		List<Integer>p = new ArrayList<>();
		int a = 0;
		int min = 101;
		for(int i = 0; i < n; i++)
			p.add(sc.nextInt());
		for(int i = -1; i <= 200; i++){
			if(!p.contains(i) && Math.abs(i - x) < min){
				a = i;
				min = Math.abs(i - x);
			}
		}
		System.out.print(a);
	} 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 List<Integer>p = new ArrayList<>(); p new ArrayList<>() int a = 0; a 0 int min = 101; min 101 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 for(int i = -1; i <= 200; i++){
			if(!p.contains(i) && Math.abs(i - x) < min){
				a = i;
				min = Math.abs(i - x);
			}
		} int i = -1; int i = -1; i -1 1 i <= 200 i 200 i++ i++ i {
			if(!p.contains(i) && Math.abs(i - x) < min){
				a = i;
				min = Math.abs(i - x);
			}
		} {
			if(!p.contains(i) && Math.abs(i - x) < min){
				a = i;
				min = Math.abs(i - x);
			}
		} if(!p.contains(i) && Math.abs(i - x) < min){
				a = 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 {
				a = i;
				min = Math.abs(i - x);
			} a = i a i min = Math.abs(i - x) min Math.abs(i - x) Math.abs Math i - x i x System.out.print(a) System.out.print System.out System System.out a 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();
		List<Integer>p = new ArrayList<>();
		int a = 0;
		int min = 101;
		for(int i = 0; i < n; i++)
			p.add(sc.nextInt());
		for(int i = -1; i <= 200; i++){
			if(!p.contains(i) && Math.abs(i - x) < min){
				a = i;
				min = Math.abs(i - x);
			}
		}
		System.out.print(a);
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		int n = sc.nextInt();
		List<Integer>p = new ArrayList<>();
		int a = 0;
		int min = 101;
		for(int i = 0; i < n; i++)
			p.add(sc.nextInt());
		for(int i = -1; i <= 200; i++){
			if(!p.contains(i) && Math.abs(i - x) < min){
				a = i;
				min = Math.abs(i - x);
			}
		}
		System.out.print(a);
	}
} Main
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		int n = sc.nextInt();
		List<Integer>p = new ArrayList<>();
		int a = 0;
		int min = 101;
		for(int i = 0; i < n; i++)
			p.add(sc.nextInt());
		for(int i = -1; i <= 200; i++){
			if(!p.contains(i) && Math.abs(i - x) < min){
				a = i;
				min = Math.abs(i - x);
			}
		}
		System.out.print(a);
	}
}
