import 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();
		HashSet<Integer> set = new HashSet<>();
		for(int i = 0;i < n; ++i){
			set.add(scan.nextInt());
		}
		int diff = 99999;
		int ans  = x;
		for(int i = 0;i <= 101; ++i){
			if(!set.contains(i)){
				if(Math.abs(i-x) < diff){
					ans = i;
					diff = Math.abs(i-x);
				}
			}
		}
		System.out.print(ans);
	}
} import java.util.*; util.* java public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int x = scan.nextInt();
		int n = scan.nextInt();
		HashSet<Integer> set = new HashSet<>();
		for(int i = 0;i < n; ++i){
			set.add(scan.nextInt());
		}
		int diff = 99999;
		int ans  = x;
		for(int i = 0;i <= 101; ++i){
			if(!set.contains(i)){
				if(Math.abs(i-x) < diff){
					ans = i;
					diff = Math.abs(i-x);
				}
			}
		}
		System.out.print(ans);
	}
} Main public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int x = scan.nextInt();
		int n = scan.nextInt();
		HashSet<Integer> set = new HashSet<>();
		for(int i = 0;i < n; ++i){
			set.add(scan.nextInt());
		}
		int diff = 99999;
		int ans  = x;
		for(int i = 0;i <= 101; ++i){
			if(!set.contains(i)){
				if(Math.abs(i-x) < diff){
					ans = i;
					diff = Math.abs(i-x);
				}
			}
		}
		System.out.print(ans);
	} main {
		Scanner scan = new Scanner(System.in);
		int x = scan.nextInt();
		int n = scan.nextInt();
		HashSet<Integer> set = new HashSet<>();
		for(int i = 0;i < n; ++i){
			set.add(scan.nextInt());
		}
		int diff = 99999;
		int ans  = x;
		for(int i = 0;i <= 101; ++i){
			if(!set.contains(i)){
				if(Math.abs(i-x) < diff){
					ans = i;
					diff = Math.abs(i-x);
				}
			}
		}
		System.out.print(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 HashSet<Integer> set = new HashSet<>(); set new HashSet<>() for(int i = 0;i < n; ++i){
			set.add(scan.nextInt());
		} int i = 0; int i = 0; i 0 i < n i n ++i ++i i {
			set.add(scan.nextInt());
		} {
			set.add(scan.nextInt());
		} set.add(scan.nextInt()) set.add set scan.nextInt() scan.nextInt scan int diff = 99999; diff 99999 int ans  = x; ans x for(int i = 0;i <= 101; ++i){
			if(!set.contains(i)){
				if(Math.abs(i-x) < diff){
					ans = i;
					diff = Math.abs(i-x);
				}
			}
		} int i = 0; int i = 0; i 0 i <= 101 i 101 ++i ++i i {
			if(!set.contains(i)){
				if(Math.abs(i-x) < diff){
					ans = i;
					diff = Math.abs(i-x);
				}
			}
		} {
			if(!set.contains(i)){
				if(Math.abs(i-x) < diff){
					ans = i;
					diff = Math.abs(i-x);
				}
			}
		} if(!set.contains(i)){
				if(Math.abs(i-x) < diff){
					ans = i;
					diff = Math.abs(i-x);
				}
			} !set.contains(i) set.contains(i) set.contains set i {
				if(Math.abs(i-x) < diff){
					ans = i;
					diff = Math.abs(i-x);
				}
			} if(Math.abs(i-x) < diff){
					ans = i;
					diff = Math.abs(i-x);
				} Math.abs(i-x) < diff Math.abs(i-x) Math.abs Math i-x i x diff {
					ans = i;
					diff = Math.abs(i-x);
				} ans = i ans i diff = Math.abs(i-x) diff Math.abs(i-x) Math.abs Math i-x i x System.out.print(ans) System.out.print 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();
		HashSet<Integer> set = new HashSet<>();
		for(int i = 0;i < n; ++i){
			set.add(scan.nextInt());
		}
		int diff = 99999;
		int ans  = x;
		for(int i = 0;i <= 101; ++i){
			if(!set.contains(i)){
				if(Math.abs(i-x) < diff){
					ans = i;
					diff = Math.abs(i-x);
				}
			}
		}
		System.out.print(ans);
	}
} public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int x = scan.nextInt();
		int n = scan.nextInt();
		HashSet<Integer> set = new HashSet<>();
		for(int i = 0;i < n; ++i){
			set.add(scan.nextInt());
		}
		int diff = 99999;
		int ans  = x;
		for(int i = 0;i <= 101; ++i){
			if(!set.contains(i)){
				if(Math.abs(i-x) < diff){
					ans = i;
					diff = Math.abs(i-x);
				}
			}
		}
		System.out.print(ans);
	}
} Main
import 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();
		HashSet<Integer> set = new HashSet<>();
		for(int i = 0;i < n; ++i){
			set.add(scan.nextInt());
		}
		int diff = 99999;
		int ans  = x;
		for(int i = 0;i <= 101; ++i){
			if(!set.contains(i)){
				if(Math.abs(i-x) < diff){
					ans = i;
					diff = Math.abs(i-x);
				}
			}
		}
		System.out.print(ans);
	}
}
