
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		final int x = sc.nextInt();
		final int n = sc.nextInt();
		int result = 110;
		int[] arr = new int[110];
		if(n != 0) {
			for(int i = 0; i < n; i++) {
				int tmp = sc.nextInt();
				arr[tmp] = tmp;
			}
			int minAbs = 110;
			for(int i = 0; i <= 101; i++) {
				int abs = Math.abs(x - i);
				if(arr[i] == 0 && abs < minAbs) {
					minAbs = abs;
					result = i;
				}
			}
		} else {
			result = x;
		}
		System.out.println(result);
	}

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

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		final int x = sc.nextInt();
		final int n = sc.nextInt();
		int result = 110;
		int[] arr = new int[110];
		if(n != 0) {
			for(int i = 0; i < n; i++) {
				int tmp = sc.nextInt();
				arr[tmp] = tmp;
			}
			int minAbs = 110;
			for(int i = 0; i <= 101; i++) {
				int abs = Math.abs(x - i);
				if(arr[i] == 0 && abs < minAbs) {
					minAbs = abs;
					result = i;
				}
			}
		} else {
			result = x;
		}
		System.out.println(result);
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		final int x = sc.nextInt();
		final int n = sc.nextInt();
		int result = 110;
		int[] arr = new int[110];
		if(n != 0) {
			for(int i = 0; i < n; i++) {
				int tmp = sc.nextInt();
				arr[tmp] = tmp;
			}
			int minAbs = 110;
			for(int i = 0; i <= 101; i++) {
				int abs = Math.abs(x - i);
				if(arr[i] == 0 && abs < minAbs) {
					minAbs = abs;
					result = i;
				}
			}
		} else {
			result = x;
		}
		System.out.println(result);
	} main {
		Scanner sc = new Scanner(System.in);
		final int x = sc.nextInt();
		final int n = sc.nextInt();
		int result = 110;
		int[] arr = new int[110];
		if(n != 0) {
			for(int i = 0; i < n; i++) {
				int tmp = sc.nextInt();
				arr[tmp] = tmp;
			}
			int minAbs = 110;
			for(int i = 0; i <= 101; i++) {
				int abs = Math.abs(x - i);
				if(arr[i] == 0 && abs < minAbs) {
					minAbs = abs;
					result = i;
				}
			}
		} else {
			result = x;
		}
		System.out.println(result);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) final int x = sc.nextInt(); x sc.nextInt() sc.nextInt sc final int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int result = 110; result 110 int[] arr = new int[110]; arr new int[110] 110 if(n != 0) {
			for(int i = 0; i < n; i++) {
				int tmp = sc.nextInt();
				arr[tmp] = tmp;
			}
			int minAbs = 110;
			for(int i = 0; i <= 101; i++) {
				int abs = Math.abs(x - i);
				if(arr[i] == 0 && abs < minAbs) {
					minAbs = abs;
					result = i;
				}
			}
		} else {
			result = x;
		} n != 0 n 0 {
			for(int i = 0; i < n; i++) {
				int tmp = sc.nextInt();
				arr[tmp] = tmp;
			}
			int minAbs = 110;
			for(int i = 0; i <= 101; i++) {
				int abs = Math.abs(x - i);
				if(arr[i] == 0 && abs < minAbs) {
					minAbs = abs;
					result = i;
				}
			}
		} for(int i = 0; i < n; i++) {
				int tmp = sc.nextInt();
				arr[tmp] = tmp;
			} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
				int tmp = sc.nextInt();
				arr[tmp] = tmp;
			} {
				int tmp = sc.nextInt();
				arr[tmp] = tmp;
			} int tmp = sc.nextInt(); tmp sc.nextInt() sc.nextInt sc arr[tmp] = tmp arr[tmp] arr tmp tmp int minAbs = 110; minAbs 110 for(int i = 0; i <= 101; i++) {
				int abs = Math.abs(x - i);
				if(arr[i] == 0 && abs < minAbs) {
					minAbs = abs;
					result = i;
				}
			} int i = 0; int i = 0; i 0 i <= 101 i 101 i++ i++ i {
				int abs = Math.abs(x - i);
				if(arr[i] == 0 && abs < minAbs) {
					minAbs = abs;
					result = i;
				}
			} {
				int abs = Math.abs(x - i);
				if(arr[i] == 0 && abs < minAbs) {
					minAbs = abs;
					result = i;
				}
			} int abs = Math.abs(x - i); abs Math.abs(x - i) Math.abs Math x - i x i if(arr[i] == 0 && abs < minAbs) {
					minAbs = abs;
					result = i;
				} arr[i] == 0 && abs < minAbs arr[i] == 0 arr[i] arr i 0 abs < minAbs abs minAbs {
					minAbs = abs;
					result = i;
				} minAbs = abs minAbs abs result = i result i {
			result = x;
		} result = x result x System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		final int x = sc.nextInt();
		final int n = sc.nextInt();
		int result = 110;
		int[] arr = new int[110];
		if(n != 0) {
			for(int i = 0; i < n; i++) {
				int tmp = sc.nextInt();
				arr[tmp] = tmp;
			}
			int minAbs = 110;
			for(int i = 0; i <= 101; i++) {
				int abs = Math.abs(x - i);
				if(arr[i] == 0 && abs < minAbs) {
					minAbs = abs;
					result = i;
				}
			}
		} else {
			result = x;
		}
		System.out.println(result);
	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		final int x = sc.nextInt();
		final int n = sc.nextInt();
		int result = 110;
		int[] arr = new int[110];
		if(n != 0) {
			for(int i = 0; i < n; i++) {
				int tmp = sc.nextInt();
				arr[tmp] = tmp;
			}
			int minAbs = 110;
			for(int i = 0; i <= 101; i++) {
				int abs = Math.abs(x - i);
				if(arr[i] == 0 && abs < minAbs) {
					minAbs = abs;
					result = i;
				}
			}
		} else {
			result = x;
		}
		System.out.println(result);
	}

} Main

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		final int x = sc.nextInt();
		final int n = sc.nextInt();
		int result = 110;
		int[] arr = new int[110];
		if(n != 0) {
			for(int i = 0; i < n; i++) {
				int tmp = sc.nextInt();
				arr[tmp] = tmp;
			}
			int minAbs = 110;
			for(int i = 0; i <= 101; i++) {
				int abs = Math.abs(x - i);
				if(arr[i] == 0 && abs < minAbs) {
					minAbs = abs;
					result = i;
				}
			}
		} else {
			result = x;
		}
		System.out.println(result);
	}

}
