import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		int n = sc.nextInt();
		
		int ans = 0;
		if(n == 0) {
			System.out.println(x);
		}else {
			int[] p = new int[n];
			for(int i = 0; i < n; i++) {
				p[i] = sc.nextInt();
			}
			
			int min = 100;
			for(int i = 0; i <= 101; i++) {
				boolean flag = false;
				
				for(int j = 0; j < n; j++) {
					if(i == p[j]) {
						flag = true;
						break;
					}
				}
				
				if(flag) continue;
				
				if(Math.abs(x - i) < min) {
					min = Math.abs(x - i);
					ans = i;
				}
			}
		
			System.out.println(ans);
		}
		
	}

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

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		int n = sc.nextInt();
		
		int ans = 0;
		if(n == 0) {
			System.out.println(x);
		}else {
			int[] p = new int[n];
			for(int i = 0; i < n; i++) {
				p[i] = sc.nextInt();
			}
			
			int min = 100;
			for(int i = 0; i <= 101; i++) {
				boolean flag = false;
				
				for(int j = 0; j < n; j++) {
					if(i == p[j]) {
						flag = true;
						break;
					}
				}
				
				if(flag) continue;
				
				if(Math.abs(x - i) < min) {
					min = Math.abs(x - i);
					ans = i;
				}
			}
		
			System.out.println(ans);
		}
		
	}

} Main public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		int n = sc.nextInt();
		
		int ans = 0;
		if(n == 0) {
			System.out.println(x);
		}else {
			int[] p = new int[n];
			for(int i = 0; i < n; i++) {
				p[i] = sc.nextInt();
			}
			
			int min = 100;
			for(int i = 0; i <= 101; i++) {
				boolean flag = false;
				
				for(int j = 0; j < n; j++) {
					if(i == p[j]) {
						flag = true;
						break;
					}
				}
				
				if(flag) continue;
				
				if(Math.abs(x - i) < min) {
					min = Math.abs(x - i);
					ans = i;
				}
			}
		
			System.out.println(ans);
		}
		
	} main {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		int n = sc.nextInt();
		
		int ans = 0;
		if(n == 0) {
			System.out.println(x);
		}else {
			int[] p = new int[n];
			for(int i = 0; i < n; i++) {
				p[i] = sc.nextInt();
			}
			
			int min = 100;
			for(int i = 0; i <= 101; i++) {
				boolean flag = false;
				
				for(int j = 0; j < n; j++) {
					if(i == p[j]) {
						flag = true;
						break;
					}
				}
				
				if(flag) continue;
				
				if(Math.abs(x - i) < min) {
					min = Math.abs(x - i);
					ans = i;
				}
			}
		
			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 int ans = 0; ans 0 if(n == 0) {
			System.out.println(x);
		}else {
			int[] p = new int[n];
			for(int i = 0; i < n; i++) {
				p[i] = sc.nextInt();
			}
			
			int min = 100;
			for(int i = 0; i <= 101; i++) {
				boolean flag = false;
				
				for(int j = 0; j < n; j++) {
					if(i == p[j]) {
						flag = true;
						break;
					}
				}
				
				if(flag) continue;
				
				if(Math.abs(x - i) < min) {
					min = Math.abs(x - i);
					ans = i;
				}
			}
		
			System.out.println(ans);
		} n == 0 n 0 {
			System.out.println(x);
		} System.out.println(x) System.out.println System.out System System.out x {
			int[] p = new int[n];
			for(int i = 0; i < n; i++) {
				p[i] = sc.nextInt();
			}
			
			int min = 100;
			for(int i = 0; i <= 101; i++) {
				boolean flag = false;
				
				for(int j = 0; j < n; j++) {
					if(i == p[j]) {
						flag = true;
						break;
					}
				}
				
				if(flag) continue;
				
				if(Math.abs(x - i) < min) {
					min = Math.abs(x - i);
					ans = i;
				}
			}
		
			System.out.println(ans);
		} int[] p = new int[n]; p new int[n] n for(int i = 0; i < n; i++) {
				p[i] = sc.nextInt();
			} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
				p[i] = sc.nextInt();
			} {
				p[i] = sc.nextInt();
			} p[i] = sc.nextInt() p[i] p i sc.nextInt() sc.nextInt sc int min = 100; min 100 for(int i = 0; i <= 101; i++) {
				boolean flag = false;
				
				for(int j = 0; j < n; j++) {
					if(i == p[j]) {
						flag = true;
						break;
					}
				}
				
				if(flag) continue;
				
				if(Math.abs(x - i) < min) {
					min = Math.abs(x - i);
					ans = i;
				}
			} int i = 0; int i = 0; i 0 i <= 101 i 101 i++ i++ i {
				boolean flag = false;
				
				for(int j = 0; j < n; j++) {
					if(i == p[j]) {
						flag = true;
						break;
					}
				}
				
				if(flag) continue;
				
				if(Math.abs(x - i) < min) {
					min = Math.abs(x - i);
					ans = i;
				}
			} {
				boolean flag = false;
				
				for(int j = 0; j < n; j++) {
					if(i == p[j]) {
						flag = true;
						break;
					}
				}
				
				if(flag) continue;
				
				if(Math.abs(x - i) < min) {
					min = Math.abs(x - i);
					ans = i;
				}
			} boolean flag = false; flag false for(int j = 0; j < n; j++) {
					if(i == p[j]) {
						flag = true;
						break;
					}
				} int j = 0; int j = 0; j 0 j < n j n j++ j++ j {
					if(i == p[j]) {
						flag = true;
						break;
					}
				} {
					if(i == p[j]) {
						flag = true;
						break;
					}
				} if(i == p[j]) {
						flag = true;
						break;
					} i == p[j] i p[j] p j {
						flag = true;
						break;
					} flag = true flag true break; if(flag) continue; flag continue; if(Math.abs(x - i) < min) {
					min = Math.abs(x - i);
					ans = i;
				} Math.abs(x - i) < min Math.abs(x - i) Math.abs Math x - i x i min {
					min = Math.abs(x - i);
					ans = i;
				} min = Math.abs(x - i) min Math.abs(x - i) Math.abs Math x - i x 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) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		int n = sc.nextInt();
		
		int ans = 0;
		if(n == 0) {
			System.out.println(x);
		}else {
			int[] p = new int[n];
			for(int i = 0; i < n; i++) {
				p[i] = sc.nextInt();
			}
			
			int min = 100;
			for(int i = 0; i <= 101; i++) {
				boolean flag = false;
				
				for(int j = 0; j < n; j++) {
					if(i == p[j]) {
						flag = true;
						break;
					}
				}
				
				if(flag) continue;
				
				if(Math.abs(x - i) < min) {
					min = Math.abs(x - i);
					ans = i;
				}
			}
		
			System.out.println(ans);
		}
		
	}

} public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		int n = sc.nextInt();
		
		int ans = 0;
		if(n == 0) {
			System.out.println(x);
		}else {
			int[] p = new int[n];
			for(int i = 0; i < n; i++) {
				p[i] = sc.nextInt();
			}
			
			int min = 100;
			for(int i = 0; i <= 101; i++) {
				boolean flag = false;
				
				for(int j = 0; j < n; j++) {
					if(i == p[j]) {
						flag = true;
						break;
					}
				}
				
				if(flag) continue;
				
				if(Math.abs(x - i) < min) {
					min = Math.abs(x - i);
					ans = i;
				}
			}
		
			System.out.println(ans);
		}
		
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		int n = sc.nextInt();
		
		int ans = 0;
		if(n == 0) {
			System.out.println(x);
		}else {
			int[] p = new int[n];
			for(int i = 0; i < n; i++) {
				p[i] = sc.nextInt();
			}
			
			int min = 100;
			for(int i = 0; i <= 101; i++) {
				boolean flag = false;
				
				for(int j = 0; j < n; j++) {
					if(i == p[j]) {
						flag = true;
						break;
					}
				}
				
				if(flag) continue;
				
				if(Math.abs(x - i) < min) {
					min = Math.abs(x - i);
					ans = i;
				}
			}
		
			System.out.println(ans);
		}
		
	}

}
