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();
		
		boolean[] isP = new boolean[102];
		for (int i = 0; i < n; i++) {
			int p = sc.nextInt();
			isP[p] = true;
		}
		
		int ans = -1;
		int minAbs = Math.abs(x + 1);
		for (int i = 0; i <= 101; i++) {
			if (isP[i]) continue;
			
			int abs = Math.abs(x - i);
			if (abs < minAbs) {
				minAbs = abs;
				ans = i;
			}
		}
		
		System.out.println(ans);

		sc.close();
	}
}

 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();
		
		boolean[] isP = new boolean[102];
		for (int i = 0; i < n; i++) {
			int p = sc.nextInt();
			isP[p] = true;
		}
		
		int ans = -1;
		int minAbs = Math.abs(x + 1);
		for (int i = 0; i <= 101; i++) {
			if (isP[i]) continue;
			
			int abs = Math.abs(x - i);
			if (abs < minAbs) {
				minAbs = abs;
				ans = i;
			}
		}
		
		System.out.println(ans);

		sc.close();
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int x = sc.nextInt();
		int n = sc.nextInt();
		
		boolean[] isP = new boolean[102];
		for (int i = 0; i < n; i++) {
			int p = sc.nextInt();
			isP[p] = true;
		}
		
		int ans = -1;
		int minAbs = Math.abs(x + 1);
		for (int i = 0; i <= 101; i++) {
			if (isP[i]) continue;
			
			int abs = Math.abs(x - i);
			if (abs < minAbs) {
				minAbs = abs;
				ans = i;
			}
		}
		
		System.out.println(ans);

		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		
		int x = sc.nextInt();
		int n = sc.nextInt();
		
		boolean[] isP = new boolean[102];
		for (int i = 0; i < n; i++) {
			int p = sc.nextInt();
			isP[p] = true;
		}
		
		int ans = -1;
		int minAbs = Math.abs(x + 1);
		for (int i = 0; i <= 101; i++) {
			if (isP[i]) continue;
			
			int abs = Math.abs(x - i);
			if (abs < minAbs) {
				minAbs = abs;
				ans = i;
			}
		}
		
		System.out.println(ans);

		sc.close();
	} 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 boolean[] isP = new boolean[102]; isP new boolean[102] 102 for (int i = 0; i < n; i++) {
			int p = sc.nextInt();
			isP[p] = true;
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			int p = sc.nextInt();
			isP[p] = true;
		} {
			int p = sc.nextInt();
			isP[p] = true;
		} int p = sc.nextInt(); p sc.nextInt() sc.nextInt sc isP[p] = true isP[p] isP p true int ans = -1; ans -1 1 int minAbs = Math.abs(x + 1); minAbs Math.abs(x + 1) Math.abs Math x + 1 x 1 for (int i = 0; i <= 101; i++) {
			if (isP[i]) continue;
			
			int abs = Math.abs(x - i);
			if (abs < minAbs) {
				minAbs = abs;
				ans = i;
			}
		} int i = 0; int i = 0; i 0 i <= 101 i 101 i++ i++ i {
			if (isP[i]) continue;
			
			int abs = Math.abs(x - i);
			if (abs < minAbs) {
				minAbs = abs;
				ans = i;
			}
		} {
			if (isP[i]) continue;
			
			int abs = Math.abs(x - i);
			if (abs < minAbs) {
				minAbs = abs;
				ans = i;
			}
		} if (isP[i]) continue; isP[i] isP i continue; int abs = Math.abs(x - i); abs Math.abs(x - i) Math.abs Math x - i x i if (abs < minAbs) {
				minAbs = abs;
				ans = i;
			} abs < minAbs abs minAbs {
				minAbs = abs;
				ans = i;
			} minAbs = abs minAbs abs ans = i ans i System.out.println(ans) System.out.println System.out System System.out ans sc.close() sc.close sc 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();
		
		boolean[] isP = new boolean[102];
		for (int i = 0; i < n; i++) {
			int p = sc.nextInt();
			isP[p] = true;
		}
		
		int ans = -1;
		int minAbs = Math.abs(x + 1);
		for (int i = 0; i <= 101; i++) {
			if (isP[i]) continue;
			
			int abs = Math.abs(x - i);
			if (abs < minAbs) {
				minAbs = abs;
				ans = i;
			}
		}
		
		System.out.println(ans);

		sc.close();
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int x = sc.nextInt();
		int n = sc.nextInt();
		
		boolean[] isP = new boolean[102];
		for (int i = 0; i < n; i++) {
			int p = sc.nextInt();
			isP[p] = true;
		}
		
		int ans = -1;
		int minAbs = Math.abs(x + 1);
		for (int i = 0; i <= 101; i++) {
			if (isP[i]) continue;
			
			int abs = Math.abs(x - i);
			if (abs < minAbs) {
				minAbs = abs;
				ans = i;
			}
		}
		
		System.out.println(ans);

		sc.close();
	}
} Main
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();
		
		boolean[] isP = new boolean[102];
		for (int i = 0; i < n; i++) {
			int p = sc.nextInt();
			isP[p] = true;
		}
		
		int ans = -1;
		int minAbs = Math.abs(x + 1);
		for (int i = 0; i <= 101; i++) {
			if (isP[i]) continue;
			
			int abs = Math.abs(x - i);
			if (abs < minAbs) {
				minAbs = abs;
				ans = i;
			}
		}
		
		System.out.println(ans);

		sc.close();
	}
}


