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();
		sc.nextLine();
		int[] ps = new int[102];
		int nearest = 0;
		for (int i = 0; i < n; i++) {
			ps[sc.nextInt()] = 1;
		}
		
		for (int i = 0; i < 102; i++) {
			if (ps[i] == 1) {
				continue;
			}
			if (x - nearest > Math.abs(x - i)) {
				nearest = i;
			}
		}
		System.out.println(nearest);
	}
} 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();
		sc.nextLine();
		int[] ps = new int[102];
		int nearest = 0;
		for (int i = 0; i < n; i++) {
			ps[sc.nextInt()] = 1;
		}
		
		for (int i = 0; i < 102; i++) {
			if (ps[i] == 1) {
				continue;
			}
			if (x - nearest > Math.abs(x - i)) {
				nearest = i;
			}
		}
		System.out.println(nearest);
	}
} Main public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		int n = sc.nextInt();
		sc.nextLine();
		int[] ps = new int[102];
		int nearest = 0;
		for (int i = 0; i < n; i++) {
			ps[sc.nextInt()] = 1;
		}
		
		for (int i = 0; i < 102; i++) {
			if (ps[i] == 1) {
				continue;
			}
			if (x - nearest > Math.abs(x - i)) {
				nearest = i;
			}
		}
		System.out.println(nearest);
	} main {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		int n = sc.nextInt();
		sc.nextLine();
		int[] ps = new int[102];
		int nearest = 0;
		for (int i = 0; i < n; i++) {
			ps[sc.nextInt()] = 1;
		}
		
		for (int i = 0; i < 102; i++) {
			if (ps[i] == 1) {
				continue;
			}
			if (x - nearest > Math.abs(x - i)) {
				nearest = i;
			}
		}
		System.out.println(nearest);
	} 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 sc.nextLine() sc.nextLine sc int[] ps = new int[102]; ps new int[102] 102 int nearest = 0; nearest 0 for (int i = 0; i < n; i++) {
			ps[sc.nextInt()] = 1;
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			ps[sc.nextInt()] = 1;
		} {
			ps[sc.nextInt()] = 1;
		} ps[sc.nextInt()] = 1 ps[sc.nextInt()] ps sc.nextInt() sc.nextInt sc 1 for (int i = 0; i < 102; i++) {
			if (ps[i] == 1) {
				continue;
			}
			if (x - nearest > Math.abs(x - i)) {
				nearest = i;
			}
		} int i = 0; int i = 0; i 0 i < 102 i 102 i++ i++ i {
			if (ps[i] == 1) {
				continue;
			}
			if (x - nearest > Math.abs(x - i)) {
				nearest = i;
			}
		} {
			if (ps[i] == 1) {
				continue;
			}
			if (x - nearest > Math.abs(x - i)) {
				nearest = i;
			}
		} if (ps[i] == 1) {
				continue;
			} ps[i] == 1 ps[i] ps i 1 {
				continue;
			} continue; if (x - nearest > Math.abs(x - i)) {
				nearest = i;
			} x - nearest > Math.abs(x - i) x - nearest x nearest Math.abs(x - i) Math.abs Math x - i x i {
				nearest = i;
			} nearest = i nearest i System.out.println(nearest) System.out.println System.out System System.out nearest 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();
		sc.nextLine();
		int[] ps = new int[102];
		int nearest = 0;
		for (int i = 0; i < n; i++) {
			ps[sc.nextInt()] = 1;
		}
		
		for (int i = 0; i < 102; i++) {
			if (ps[i] == 1) {
				continue;
			}
			if (x - nearest > Math.abs(x - i)) {
				nearest = i;
			}
		}
		System.out.println(nearest);
	}
} public class Main {
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		int n = sc.nextInt();
		sc.nextLine();
		int[] ps = new int[102];
		int nearest = 0;
		for (int i = 0; i < n; i++) {
			ps[sc.nextInt()] = 1;
		}
		
		for (int i = 0; i < 102; i++) {
			if (ps[i] == 1) {
				continue;
			}
			if (x - nearest > Math.abs(x - i)) {
				nearest = i;
			}
		}
		System.out.println(nearest);
	}
} 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();
		sc.nextLine();
		int[] ps = new int[102];
		int nearest = 0;
		for (int i = 0; i < n; i++) {
			ps[sc.nextInt()] = 1;
		}
		
		for (int i = 0; i < 102; i++) {
			if (ps[i] == 1) {
				continue;
			}
			if (x - nearest > Math.abs(x - i)) {
				nearest = i;
			}
		}
		System.out.println(nearest);
	}
}
