import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		try(Scanner sc = new Scanner(System.in)) {
			
			int x = sc.nextInt();
			int n = sc.nextInt();
			
			int[] pArray = new int[100+2];
			
			for(int i = 0 ; i <= 101 ; i++ ) {
				pArray[i] = (int)Math.abs(x - i);
			}
						
			for(int i = 0 ; i < n ; i++ ) {
				int index = sc.nextInt();
				pArray[index] = Integer.MAX_VALUE;
			}
			
			int ans = 0;
			int minDiff = pArray[0];
			
			for(int i = 1 ; i <= 101 ; i++ ) {
				if ( pArray[i] < minDiff) {
					ans = i;
					minDiff = pArray[i];
				}
			}
			
			System.out.println(ans);
				
		}
	}

} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args){
		try(Scanner sc = new Scanner(System.in)) {
			
			int x = sc.nextInt();
			int n = sc.nextInt();
			
			int[] pArray = new int[100+2];
			
			for(int i = 0 ; i <= 101 ; i++ ) {
				pArray[i] = (int)Math.abs(x - i);
			}
						
			for(int i = 0 ; i < n ; i++ ) {
				int index = sc.nextInt();
				pArray[index] = Integer.MAX_VALUE;
			}
			
			int ans = 0;
			int minDiff = pArray[0];
			
			for(int i = 1 ; i <= 101 ; i++ ) {
				if ( pArray[i] < minDiff) {
					ans = i;
					minDiff = pArray[i];
				}
			}
			
			System.out.println(ans);
				
		}
	}

} Main public static void main(String[] args){
		try(Scanner sc = new Scanner(System.in)) {
			
			int x = sc.nextInt();
			int n = sc.nextInt();
			
			int[] pArray = new int[100+2];
			
			for(int i = 0 ; i <= 101 ; i++ ) {
				pArray[i] = (int)Math.abs(x - i);
			}
						
			for(int i = 0 ; i < n ; i++ ) {
				int index = sc.nextInt();
				pArray[index] = Integer.MAX_VALUE;
			}
			
			int ans = 0;
			int minDiff = pArray[0];
			
			for(int i = 1 ; i <= 101 ; i++ ) {
				if ( pArray[i] < minDiff) {
					ans = i;
					minDiff = pArray[i];
				}
			}
			
			System.out.println(ans);
				
		}
	} main {
		try(Scanner sc = new Scanner(System.in)) {
			
			int x = sc.nextInt();
			int n = sc.nextInt();
			
			int[] pArray = new int[100+2];
			
			for(int i = 0 ; i <= 101 ; i++ ) {
				pArray[i] = (int)Math.abs(x - i);
			}
						
			for(int i = 0 ; i < n ; i++ ) {
				int index = sc.nextInt();
				pArray[index] = Integer.MAX_VALUE;
			}
			
			int ans = 0;
			int minDiff = pArray[0];
			
			for(int i = 1 ; i <= 101 ; i++ ) {
				if ( pArray[i] < minDiff) {
					ans = i;
					minDiff = pArray[i];
				}
			}
			
			System.out.println(ans);
				
		}
	} try(Scanner sc = new Scanner(System.in)) {
			
			int x = sc.nextInt();
			int n = sc.nextInt();
			
			int[] pArray = new int[100+2];
			
			for(int i = 0 ; i <= 101 ; i++ ) {
				pArray[i] = (int)Math.abs(x - i);
			}
						
			for(int i = 0 ; i < n ; i++ ) {
				int index = sc.nextInt();
				pArray[index] = Integer.MAX_VALUE;
			}
			
			int ans = 0;
			int minDiff = pArray[0];
			
			for(int i = 1 ; i <= 101 ; i++ ) {
				if ( pArray[i] < minDiff) {
					ans = i;
					minDiff = pArray[i];
				}
			}
			
			System.out.println(ans);
				
		} {
			
			int x = sc.nextInt();
			int n = sc.nextInt();
			
			int[] pArray = new int[100+2];
			
			for(int i = 0 ; i <= 101 ; i++ ) {
				pArray[i] = (int)Math.abs(x - i);
			}
						
			for(int i = 0 ; i < n ; i++ ) {
				int index = sc.nextInt();
				pArray[index] = Integer.MAX_VALUE;
			}
			
			int ans = 0;
			int minDiff = pArray[0];
			
			for(int i = 1 ; i <= 101 ; i++ ) {
				if ( pArray[i] < minDiff) {
					ans = i;
					minDiff = pArray[i];
				}
			}
			
			System.out.println(ans);
				
		} Scanner sc = new Scanner(System.in) Scanner sc = new Scanner(System.in) 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[] pArray = new int[100+2]; pArray new int[100+2] 100+2 100 2 for(int i = 0 ; i <= 101 ; i++ ) {
				pArray[i] = (int)Math.abs(x - i);
			} int i = 0 ; int i = 0 ; i 0 i <= 101 i 101 i++ i++ i {
				pArray[i] = (int)Math.abs(x - i);
			} {
				pArray[i] = (int)Math.abs(x - i);
			} pArray[i] = (int)Math.abs(x - i) pArray[i] pArray i (int)Math.abs(x - i) Math.abs Math x - i x i for(int i = 0 ; i < n ; i++ ) {
				int index = sc.nextInt();
				pArray[index] = Integer.MAX_VALUE;
			} int i = 0 ; int i = 0 ; i 0 i < n i n i++ i++ i {
				int index = sc.nextInt();
				pArray[index] = Integer.MAX_VALUE;
			} {
				int index = sc.nextInt();
				pArray[index] = Integer.MAX_VALUE;
			} int index = sc.nextInt(); index sc.nextInt() sc.nextInt sc pArray[index] = Integer.MAX_VALUE pArray[index] pArray index Integer.MAX_VALUE Integer Integer.MAX_VALUE int ans = 0; ans 0 int minDiff = pArray[0]; minDiff pArray[0] pArray 0 for(int i = 1 ; i <= 101 ; i++ ) {
				if ( pArray[i] < minDiff) {
					ans = i;
					minDiff = pArray[i];
				}
			} int i = 1 ; int i = 1 ; i 1 i <= 101 i 101 i++ i++ i {
				if ( pArray[i] < minDiff) {
					ans = i;
					minDiff = pArray[i];
				}
			} {
				if ( pArray[i] < minDiff) {
					ans = i;
					minDiff = pArray[i];
				}
			} if ( pArray[i] < minDiff) {
					ans = i;
					minDiff = pArray[i];
				} pArray[i] < minDiff pArray[i] pArray i minDiff {
					ans = i;
					minDiff = pArray[i];
				} ans = i ans i minDiff = pArray[i] minDiff pArray[i] pArray 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){
		try(Scanner sc = new Scanner(System.in)) {
			
			int x = sc.nextInt();
			int n = sc.nextInt();
			
			int[] pArray = new int[100+2];
			
			for(int i = 0 ; i <= 101 ; i++ ) {
				pArray[i] = (int)Math.abs(x - i);
			}
						
			for(int i = 0 ; i < n ; i++ ) {
				int index = sc.nextInt();
				pArray[index] = Integer.MAX_VALUE;
			}
			
			int ans = 0;
			int minDiff = pArray[0];
			
			for(int i = 1 ; i <= 101 ; i++ ) {
				if ( pArray[i] < minDiff) {
					ans = i;
					minDiff = pArray[i];
				}
			}
			
			System.out.println(ans);
				
		}
	}

} public class Main {
	public static void main(String[] args){
		try(Scanner sc = new Scanner(System.in)) {
			
			int x = sc.nextInt();
			int n = sc.nextInt();
			
			int[] pArray = new int[100+2];
			
			for(int i = 0 ; i <= 101 ; i++ ) {
				pArray[i] = (int)Math.abs(x - i);
			}
						
			for(int i = 0 ; i < n ; i++ ) {
				int index = sc.nextInt();
				pArray[index] = Integer.MAX_VALUE;
			}
			
			int ans = 0;
			int minDiff = pArray[0];
			
			for(int i = 1 ; i <= 101 ; i++ ) {
				if ( pArray[i] < minDiff) {
					ans = i;
					minDiff = pArray[i];
				}
			}
			
			System.out.println(ans);
				
		}
	}

} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		try(Scanner sc = new Scanner(System.in)) {
			
			int x = sc.nextInt();
			int n = sc.nextInt();
			
			int[] pArray = new int[100+2];
			
			for(int i = 0 ; i <= 101 ; i++ ) {
				pArray[i] = (int)Math.abs(x - i);
			}
						
			for(int i = 0 ; i < n ; i++ ) {
				int index = sc.nextInt();
				pArray[index] = Integer.MAX_VALUE;
			}
			
			int ans = 0;
			int minDiff = pArray[0];
			
			for(int i = 1 ; i <= 101 ; i++ ) {
				if ( pArray[i] < minDiff) {
					ans = i;
					minDiff = pArray[i];
				}
			}
			
			System.out.println(ans);
				
		}
	}

}