import java.util.*;

public class Main {
	Scanner sc = new Scanner(System.in);
	final int MOD = 998244353;
	final int MAX = Integer.MAX_VALUE;
	final long LMAX = Long.MAX_VALUE;
	int len = (int)1e6 + 1;
	
	
	void doIt() {
		int X = sc.nextInt();
		int N = sc.nextInt();
		boolean[] able = new boolean[201];
		Arrays.fill(able, true);
		for(int i = 0; i < N; i++) {
			int p = sc.nextInt();
			able[p] = false;
		}
		for(int i = 0; i <= 100; i++) {
			if(able[X-i]) {
				System.out.println(X-i);
				return;
			}
			if(able[X+i]) {
				System.out.println(X+i);
				return;
			}
		}
	}
	
	
	public static void main(String[] args) {
		new Main().doIt();
	}

} import java.util.*; util.* java public class Main {
	Scanner sc = new Scanner(System.in);
	final int MOD = 998244353;
	final int MAX = Integer.MAX_VALUE;
	final long LMAX = Long.MAX_VALUE;
	int len = (int)1e6 + 1;
	
	
	void doIt() {
		int X = sc.nextInt();
		int N = sc.nextInt();
		boolean[] able = new boolean[201];
		Arrays.fill(able, true);
		for(int i = 0; i < N; i++) {
			int p = sc.nextInt();
			able[p] = false;
		}
		for(int i = 0; i <= 100; i++) {
			if(able[X-i]) {
				System.out.println(X-i);
				return;
			}
			if(able[X+i]) {
				System.out.println(X+i);
				return;
			}
		}
	}
	
	
	public static void main(String[] args) {
		new Main().doIt();
	}

} Main Scanner sc = new Scanner(System.in); sc new Scanner(System.in) final int MOD = 998244353; MOD 998244353 final int MAX = Integer.MAX_VALUE; MAX Integer.MAX_VALUE Integer Integer.MAX_VALUE final long LMAX = Long.MAX_VALUE; LMAX Long.MAX_VALUE Long Long.MAX_VALUE int len = (int)1e6 + 1; len (int)1e6 + 1 (int)1e6 1 void doIt() {
		int X = sc.nextInt();
		int N = sc.nextInt();
		boolean[] able = new boolean[201];
		Arrays.fill(able, true);
		for(int i = 0; i < N; i++) {
			int p = sc.nextInt();
			able[p] = false;
		}
		for(int i = 0; i <= 100; i++) {
			if(able[X-i]) {
				System.out.println(X-i);
				return;
			}
			if(able[X+i]) {
				System.out.println(X+i);
				return;
			}
		}
	} doIt {
		int X = sc.nextInt();
		int N = sc.nextInt();
		boolean[] able = new boolean[201];
		Arrays.fill(able, true);
		for(int i = 0; i < N; i++) {
			int p = sc.nextInt();
			able[p] = false;
		}
		for(int i = 0; i <= 100; i++) {
			if(able[X-i]) {
				System.out.println(X-i);
				return;
			}
			if(able[X+i]) {
				System.out.println(X+i);
				return;
			}
		}
	} int X = sc.nextInt(); X sc.nextInt() sc.nextInt sc int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc boolean[] able = new boolean[201]; able new boolean[201] 201 Arrays.fill(able, true) Arrays.fill Arrays able true for(int i = 0; i < N; i++) {
			int p = sc.nextInt();
			able[p] = false;
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			int p = sc.nextInt();
			able[p] = false;
		} {
			int p = sc.nextInt();
			able[p] = false;
		} int p = sc.nextInt(); p sc.nextInt() sc.nextInt sc able[p] = false able[p] able p false for(int i = 0; i <= 100; i++) {
			if(able[X-i]) {
				System.out.println(X-i);
				return;
			}
			if(able[X+i]) {
				System.out.println(X+i);
				return;
			}
		} int i = 0; int i = 0; i 0 i <= 100 i 100 i++ i++ i {
			if(able[X-i]) {
				System.out.println(X-i);
				return;
			}
			if(able[X+i]) {
				System.out.println(X+i);
				return;
			}
		} {
			if(able[X-i]) {
				System.out.println(X-i);
				return;
			}
			if(able[X+i]) {
				System.out.println(X+i);
				return;
			}
		} if(able[X-i]) {
				System.out.println(X-i);
				return;
			} able[X-i] able X-i X i {
				System.out.println(X-i);
				return;
			} System.out.println(X-i) System.out.println System.out System System.out X-i X i return; if(able[X+i]) {
				System.out.println(X+i);
				return;
			} able[X+i] able X+i X i {
				System.out.println(X+i);
				return;
			} System.out.println(X+i) System.out.println System.out System System.out X+i X i return; public static void main(String[] args) {
		new Main().doIt();
	} main {
		new Main().doIt();
	} new Main().doIt() new Main().doIt new Main() String[] args args public class Main {
	Scanner sc = new Scanner(System.in);
	final int MOD = 998244353;
	final int MAX = Integer.MAX_VALUE;
	final long LMAX = Long.MAX_VALUE;
	int len = (int)1e6 + 1;
	
	
	void doIt() {
		int X = sc.nextInt();
		int N = sc.nextInt();
		boolean[] able = new boolean[201];
		Arrays.fill(able, true);
		for(int i = 0; i < N; i++) {
			int p = sc.nextInt();
			able[p] = false;
		}
		for(int i = 0; i <= 100; i++) {
			if(able[X-i]) {
				System.out.println(X-i);
				return;
			}
			if(able[X+i]) {
				System.out.println(X+i);
				return;
			}
		}
	}
	
	
	public static void main(String[] args) {
		new Main().doIt();
	}

} public class Main {
	Scanner sc = new Scanner(System.in);
	final int MOD = 998244353;
	final int MAX = Integer.MAX_VALUE;
	final long LMAX = Long.MAX_VALUE;
	int len = (int)1e6 + 1;
	
	
	void doIt() {
		int X = sc.nextInt();
		int N = sc.nextInt();
		boolean[] able = new boolean[201];
		Arrays.fill(able, true);
		for(int i = 0; i < N; i++) {
			int p = sc.nextInt();
			able[p] = false;
		}
		for(int i = 0; i <= 100; i++) {
			if(able[X-i]) {
				System.out.println(X-i);
				return;
			}
			if(able[X+i]) {
				System.out.println(X+i);
				return;
			}
		}
	}
	
	
	public static void main(String[] args) {
		new Main().doIt();
	}

} Main
import java.util.*;

public class Main {
	Scanner sc = new Scanner(System.in);
	final int MOD = 998244353;
	final int MAX = Integer.MAX_VALUE;
	final long LMAX = Long.MAX_VALUE;
	int len = (int)1e6 + 1;
	
	
	void doIt() {
		int X = sc.nextInt();
		int N = sc.nextInt();
		boolean[] able = new boolean[201];
		Arrays.fill(able, true);
		for(int i = 0; i < N; i++) {
			int p = sc.nextInt();
			able[p] = false;
		}
		for(int i = 0; i <= 100; i++) {
			if(able[X-i]) {
				System.out.println(X-i);
				return;
			}
			if(able[X+i]) {
				System.out.println(X+i);
				return;
			}
		}
	}
	
	
	public static void main(String[] args) {
		new Main().doIt();
	}

}
