import java.util.Arrays;
import java.util.Scanner;

public class Main{


	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int X = s.nextInt();
		int N = s.nextInt();
		int[] p = new int[N];
		for(int i=0; i<N; i++) {
			p[i] = s.nextInt();
		}
		int ans =0;
		Arrays.sort(p); //昇順にソート
		for(int i=0; i<=101; i++) {
			boolean include = false;
			for(int k=0; k<p.length; k++) {
				if(i == p[k]) {include = true; break;}
			}
			
			if(!include && Math.abs(X-ans) > Math.abs(X-i)  ) {
				ans = i; 
			}
		}
		
		System.out.println(ans);
		
	}

} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main{


	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int X = s.nextInt();
		int N = s.nextInt();
		int[] p = new int[N];
		for(int i=0; i<N; i++) {
			p[i] = s.nextInt();
		}
		int ans =0;
		Arrays.sort(p); //昇順にソート
		for(int i=0; i<=101; i++) {
			boolean include = false;
			for(int k=0; k<p.length; k++) {
				if(i == p[k]) {include = true; break;}
			}
			
			if(!include && Math.abs(X-ans) > Math.abs(X-i)  ) {
				ans = i; 
			}
		}
		
		System.out.println(ans);
		
	}

} Main public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int X = s.nextInt();
		int N = s.nextInt();
		int[] p = new int[N];
		for(int i=0; i<N; i++) {
			p[i] = s.nextInt();
		}
		int ans =0;
		Arrays.sort(p); //昇順にソート
		for(int i=0; i<=101; i++) {
			boolean include = false;
			for(int k=0; k<p.length; k++) {
				if(i == p[k]) {include = true; break;}
			}
			
			if(!include && Math.abs(X-ans) > Math.abs(X-i)  ) {
				ans = i; 
			}
		}
		
		System.out.println(ans);
		
	} main {
		Scanner s = new Scanner(System.in);
		int X = s.nextInt();
		int N = s.nextInt();
		int[] p = new int[N];
		for(int i=0; i<N; i++) {
			p[i] = s.nextInt();
		}
		int ans =0;
		Arrays.sort(p); //昇順にソート
		for(int i=0; i<=101; i++) {
			boolean include = false;
			for(int k=0; k<p.length; k++) {
				if(i == p[k]) {include = true; break;}
			}
			
			if(!include && Math.abs(X-ans) > Math.abs(X-i)  ) {
				ans = i; 
			}
		}
		
		System.out.println(ans);
		
	} Scanner s = new Scanner(System.in); s new Scanner(System.in) int X = s.nextInt(); X s.nextInt() s.nextInt s int N = s.nextInt(); N s.nextInt() s.nextInt s int[] p = new int[N]; p new int[N] N for(int i=0; i<N; i++) {
			p[i] = s.nextInt();
		} int i=0; int i=0; i 0 i<N i N i++ i++ i {
			p[i] = s.nextInt();
		} {
			p[i] = s.nextInt();
		} p[i] = s.nextInt() p[i] p i s.nextInt() s.nextInt s int ans =0; ans 0 Arrays.sort(p) Arrays.sort Arrays p for(int i=0; i<=101; i++) {
			boolean include = false;
			for(int k=0; k<p.length; k++) {
				if(i == p[k]) {include = true; break;}
			}
			
			if(!include && Math.abs(X-ans) > Math.abs(X-i)  ) {
				ans = i; 
			}
		} int i=0; int i=0; i 0 i<=101 i 101 i++ i++ i {
			boolean include = false;
			for(int k=0; k<p.length; k++) {
				if(i == p[k]) {include = true; break;}
			}
			
			if(!include && Math.abs(X-ans) > Math.abs(X-i)  ) {
				ans = i; 
			}
		} {
			boolean include = false;
			for(int k=0; k<p.length; k++) {
				if(i == p[k]) {include = true; break;}
			}
			
			if(!include && Math.abs(X-ans) > Math.abs(X-i)  ) {
				ans = i; 
			}
		} boolean include = false; include false for(int k=0; k<p.length; k++) {
				if(i == p[k]) {include = true; break;}
			} int k=0; int k=0; k 0 k<p.length k p.length p p.length k++ k++ k {
				if(i == p[k]) {include = true; break;}
			} {
				if(i == p[k]) {include = true; break;}
			} if(i == p[k]) {include = true; break;} i == p[k] i p[k] p k {include = true; break;} include = true include true break; if(!include && Math.abs(X-ans) > Math.abs(X-i)  ) {
				ans = i; 
			} !include && Math.abs(X-ans) > Math.abs(X-i) !include include Math.abs(X-ans) > Math.abs(X-i) Math.abs(X-ans) Math.abs Math X-ans X ans Math.abs(X-i) Math.abs Math X-i X i {
				ans = 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 s = new Scanner(System.in);
		int X = s.nextInt();
		int N = s.nextInt();
		int[] p = new int[N];
		for(int i=0; i<N; i++) {
			p[i] = s.nextInt();
		}
		int ans =0;
		Arrays.sort(p); //昇順にソート
		for(int i=0; i<=101; i++) {
			boolean include = false;
			for(int k=0; k<p.length; k++) {
				if(i == p[k]) {include = true; break;}
			}
			
			if(!include && Math.abs(X-ans) > Math.abs(X-i)  ) {
				ans = i; 
			}
		}
		
		System.out.println(ans);
		
	}

} public class Main{


	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int X = s.nextInt();
		int N = s.nextInt();
		int[] p = new int[N];
		for(int i=0; i<N; i++) {
			p[i] = s.nextInt();
		}
		int ans =0;
		Arrays.sort(p); //昇順にソート
		for(int i=0; i<=101; i++) {
			boolean include = false;
			for(int k=0; k<p.length; k++) {
				if(i == p[k]) {include = true; break;}
			}
			
			if(!include && Math.abs(X-ans) > Math.abs(X-i)  ) {
				ans = i; 
			}
		}
		
		System.out.println(ans);
		
	}

} Main
import java.util.Arrays;
import java.util.Scanner;

public class Main{


	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int X = s.nextInt();
		int N = s.nextInt();
		int[] p = new int[N];
		for(int i=0; i<N; i++) {
			p[i] = s.nextInt();
		}
		int ans =0;
		Arrays.sort(p); //昇順にソート
		for(int i=0; i<=101; i++) {
			boolean include = false;
			for(int k=0; k<p.length; k++) {
				if(i == p[k]) {include = true; break;}
			}
			
			if(!include && Math.abs(X-ans) > Math.abs(X-i)  ) {
				ans = i; 
			}
		}
		
		System.out.println(ans);
		
	}

}
