import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int number = sc.nextInt();
		int numlength = sc.nextInt();
		boolean[] numbers = new boolean[101];

		for (int i = 0; i < numlength; i++) {
			numbers[sc.nextInt()] = true;
		}

		for (int i = 0; i < numlength + 1; i++) {
			if (numbers[number - i] == false) {
				System.out.println(number - i);
				return;
			} else if(number + i == 101){
				System.out.println(101);
				return;
			}else if (numbers[number + i] == false) {
				System.out.println(number + i);
				return;
			}
		}

	}

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

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int number = sc.nextInt();
		int numlength = sc.nextInt();
		boolean[] numbers = new boolean[101];

		for (int i = 0; i < numlength; i++) {
			numbers[sc.nextInt()] = true;
		}

		for (int i = 0; i < numlength + 1; i++) {
			if (numbers[number - i] == false) {
				System.out.println(number - i);
				return;
			} else if(number + i == 101){
				System.out.println(101);
				return;
			}else if (numbers[number + i] == false) {
				System.out.println(number + i);
				return;
			}
		}

	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int number = sc.nextInt();
		int numlength = sc.nextInt();
		boolean[] numbers = new boolean[101];

		for (int i = 0; i < numlength; i++) {
			numbers[sc.nextInt()] = true;
		}

		for (int i = 0; i < numlength + 1; i++) {
			if (numbers[number - i] == false) {
				System.out.println(number - i);
				return;
			} else if(number + i == 101){
				System.out.println(101);
				return;
			}else if (numbers[number + i] == false) {
				System.out.println(number + i);
				return;
			}
		}

	} main {
		Scanner sc = new Scanner(System.in);
		int number = sc.nextInt();
		int numlength = sc.nextInt();
		boolean[] numbers = new boolean[101];

		for (int i = 0; i < numlength; i++) {
			numbers[sc.nextInt()] = true;
		}

		for (int i = 0; i < numlength + 1; i++) {
			if (numbers[number - i] == false) {
				System.out.println(number - i);
				return;
			} else if(number + i == 101){
				System.out.println(101);
				return;
			}else if (numbers[number + i] == false) {
				System.out.println(number + i);
				return;
			}
		}

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int number = sc.nextInt(); number sc.nextInt() sc.nextInt sc int numlength = sc.nextInt(); numlength sc.nextInt() sc.nextInt sc boolean[] numbers = new boolean[101]; numbers new boolean[101] 101 for (int i = 0; i < numlength; i++) {
			numbers[sc.nextInt()] = true;
		} int i = 0; int i = 0; i 0 i < numlength i numlength i++ i++ i {
			numbers[sc.nextInt()] = true;
		} {
			numbers[sc.nextInt()] = true;
		} numbers[sc.nextInt()] = true numbers[sc.nextInt()] numbers sc.nextInt() sc.nextInt sc true for (int i = 0; i < numlength + 1; i++) {
			if (numbers[number - i] == false) {
				System.out.println(number - i);
				return;
			} else if(number + i == 101){
				System.out.println(101);
				return;
			}else if (numbers[number + i] == false) {
				System.out.println(number + i);
				return;
			}
		} int i = 0; int i = 0; i 0 i < numlength + 1 i numlength + 1 numlength 1 i++ i++ i {
			if (numbers[number - i] == false) {
				System.out.println(number - i);
				return;
			} else if(number + i == 101){
				System.out.println(101);
				return;
			}else if (numbers[number + i] == false) {
				System.out.println(number + i);
				return;
			}
		} {
			if (numbers[number - i] == false) {
				System.out.println(number - i);
				return;
			} else if(number + i == 101){
				System.out.println(101);
				return;
			}else if (numbers[number + i] == false) {
				System.out.println(number + i);
				return;
			}
		} if (numbers[number - i] == false) {
				System.out.println(number - i);
				return;
			} else if(number + i == 101){
				System.out.println(101);
				return;
			}else if (numbers[number + i] == false) {
				System.out.println(number + i);
				return;
			} numbers[number - i] == false numbers[number - i] numbers number - i number i false {
				System.out.println(number - i);
				return;
			} System.out.println(number - i) System.out.println System.out System System.out number - i number i return; if(number + i == 101){
				System.out.println(101);
				return;
			}else if (numbers[number + i] == false) {
				System.out.println(number + i);
				return;
			} number + i == 101 number + i number i 101 {
				System.out.println(101);
				return;
			} System.out.println(101) System.out.println System.out System System.out 101 return; if (numbers[number + i] == false) {
				System.out.println(number + i);
				return;
			} numbers[number + i] == false numbers[number + i] numbers number + i number i false {
				System.out.println(number + i);
				return;
			} System.out.println(number + i) System.out.println System.out System System.out number + i number i return; String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int number = sc.nextInt();
		int numlength = sc.nextInt();
		boolean[] numbers = new boolean[101];

		for (int i = 0; i < numlength; i++) {
			numbers[sc.nextInt()] = true;
		}

		for (int i = 0; i < numlength + 1; i++) {
			if (numbers[number - i] == false) {
				System.out.println(number - i);
				return;
			} else if(number + i == 101){
				System.out.println(101);
				return;
			}else if (numbers[number + i] == false) {
				System.out.println(number + i);
				return;
			}
		}

	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int number = sc.nextInt();
		int numlength = sc.nextInt();
		boolean[] numbers = new boolean[101];

		for (int i = 0; i < numlength; i++) {
			numbers[sc.nextInt()] = true;
		}

		for (int i = 0; i < numlength + 1; i++) {
			if (numbers[number - i] == false) {
				System.out.println(number - i);
				return;
			} else if(number + i == 101){
				System.out.println(101);
				return;
			}else if (numbers[number + i] == false) {
				System.out.println(number + i);
				return;
			}
		}

	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int number = sc.nextInt();
		int numlength = sc.nextInt();
		boolean[] numbers = new boolean[101];

		for (int i = 0; i < numlength; i++) {
			numbers[sc.nextInt()] = true;
		}

		for (int i = 0; i < numlength + 1; i++) {
			if (numbers[number - i] == false) {
				System.out.println(number - i);
				return;
			} else if(number + i == 101){
				System.out.println(101);
				return;
			}else if (numbers[number + i] == false) {
				System.out.println(number + i);
				return;
			}
		}

	}

}