import java.util.HashSet;
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();
		HashSet<Integer> p = new HashSet<Integer>();
		for (int i = 0; i < n; ++i) {
			p.add(sc.nextInt());
		}

		int minAbs = 200;
		int ans = 0;
		for (int possible = 0; possible <= 101; ++possible) {
			if (p.contains(possible)) {
				continue;
			}

			int abs = Math.abs(possible - x);
			if (abs < minAbs) {
				minAbs = abs;
				ans = possible;
			}
		}

		System.out.println(ans);
	}
} import java.util.HashSet; HashSet java.util 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();
		HashSet<Integer> p = new HashSet<Integer>();
		for (int i = 0; i < n; ++i) {
			p.add(sc.nextInt());
		}

		int minAbs = 200;
		int ans = 0;
		for (int possible = 0; possible <= 101; ++possible) {
			if (p.contains(possible)) {
				continue;
			}

			int abs = Math.abs(possible - x);
			if (abs < minAbs) {
				minAbs = abs;
				ans = possible;
			}
		}

		System.out.println(ans);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		int n = sc.nextInt();
		HashSet<Integer> p = new HashSet<Integer>();
		for (int i = 0; i < n; ++i) {
			p.add(sc.nextInt());
		}

		int minAbs = 200;
		int ans = 0;
		for (int possible = 0; possible <= 101; ++possible) {
			if (p.contains(possible)) {
				continue;
			}

			int abs = Math.abs(possible - x);
			if (abs < minAbs) {
				minAbs = abs;
				ans = possible;
			}
		}

		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		int n = sc.nextInt();
		HashSet<Integer> p = new HashSet<Integer>();
		for (int i = 0; i < n; ++i) {
			p.add(sc.nextInt());
		}

		int minAbs = 200;
		int ans = 0;
		for (int possible = 0; possible <= 101; ++possible) {
			if (p.contains(possible)) {
				continue;
			}

			int abs = Math.abs(possible - x);
			if (abs < minAbs) {
				minAbs = abs;
				ans = possible;
			}
		}

		System.out.println(ans);
	} 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 HashSet<Integer> p = new HashSet<Integer>(); p new HashSet<Integer>() for (int i = 0; i < n; ++i) {
			p.add(sc.nextInt());
		} int i = 0; int i = 0; i 0 i < n i n ++i ++i i {
			p.add(sc.nextInt());
		} {
			p.add(sc.nextInt());
		} p.add(sc.nextInt()) p.add p sc.nextInt() sc.nextInt sc int minAbs = 200; minAbs 200 int ans = 0; ans 0 for (int possible = 0; possible <= 101; ++possible) {
			if (p.contains(possible)) {
				continue;
			}

			int abs = Math.abs(possible - x);
			if (abs < minAbs) {
				minAbs = abs;
				ans = possible;
			}
		} int possible = 0; int possible = 0; possible 0 possible <= 101 possible 101 ++possible ++possible possible {
			if (p.contains(possible)) {
				continue;
			}

			int abs = Math.abs(possible - x);
			if (abs < minAbs) {
				minAbs = abs;
				ans = possible;
			}
		} {
			if (p.contains(possible)) {
				continue;
			}

			int abs = Math.abs(possible - x);
			if (abs < minAbs) {
				minAbs = abs;
				ans = possible;
			}
		} if (p.contains(possible)) {
				continue;
			} p.contains(possible) p.contains p possible {
				continue;
			} continue; int abs = Math.abs(possible - x); abs Math.abs(possible - x) Math.abs Math possible - x possible x if (abs < minAbs) {
				minAbs = abs;
				ans = possible;
			} abs < minAbs abs minAbs {
				minAbs = abs;
				ans = possible;
			} minAbs = abs minAbs abs ans = possible ans possible System.out.println(ans) System.out.println System.out System System.out ans 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();
		HashSet<Integer> p = new HashSet<Integer>();
		for (int i = 0; i < n; ++i) {
			p.add(sc.nextInt());
		}

		int minAbs = 200;
		int ans = 0;
		for (int possible = 0; possible <= 101; ++possible) {
			if (p.contains(possible)) {
				continue;
			}

			int abs = Math.abs(possible - x);
			if (abs < minAbs) {
				minAbs = abs;
				ans = possible;
			}
		}

		System.out.println(ans);
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		int n = sc.nextInt();
		HashSet<Integer> p = new HashSet<Integer>();
		for (int i = 0; i < n; ++i) {
			p.add(sc.nextInt());
		}

		int minAbs = 200;
		int ans = 0;
		for (int possible = 0; possible <= 101; ++possible) {
			if (p.contains(possible)) {
				continue;
			}

			int abs = Math.abs(possible - x);
			if (abs < minAbs) {
				minAbs = abs;
				ans = possible;
			}
		}

		System.out.println(ans);
	}
} Main
import java.util.HashSet;
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();
		HashSet<Integer> p = new HashSet<Integer>();
		for (int i = 0; i < n; ++i) {
			p.add(sc.nextInt());
		}

		int minAbs = 200;
		int ans = 0;
		for (int possible = 0; possible <= 101; ++possible) {
			if (p.contains(possible)) {
				continue;
			}

			int abs = Math.abs(possible - x);
			if (abs < minAbs) {
				minAbs = abs;
				ans = possible;
			}
		}

		System.out.println(ans);
	}
}
