import java.util.ArrayList;
import java.util.List;
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();
		int ans=102;
		int re=0;
		List<Integer> p = new ArrayList<Integer>();
		for(int i=0;i<n;i++) {
			p.add(sc.nextInt());
		}
		for(int i=101;i>=0;i--) {
			if(!p.contains(i)) {
				if(ans>=Math.abs(x-i)) {
					ans=Math.abs(x-i);
					re = i;
				}
			}
		}
		System.out.println(re);
	}
} import java.util.ArrayList; ArrayList java.util import java.util.List; List 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();
		int ans=102;
		int re=0;
		List<Integer> p = new ArrayList<Integer>();
		for(int i=0;i<n;i++) {
			p.add(sc.nextInt());
		}
		for(int i=101;i>=0;i--) {
			if(!p.contains(i)) {
				if(ans>=Math.abs(x-i)) {
					ans=Math.abs(x-i);
					re = i;
				}
			}
		}
		System.out.println(re);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		int n = sc.nextInt();
		int ans=102;
		int re=0;
		List<Integer> p = new ArrayList<Integer>();
		for(int i=0;i<n;i++) {
			p.add(sc.nextInt());
		}
		for(int i=101;i>=0;i--) {
			if(!p.contains(i)) {
				if(ans>=Math.abs(x-i)) {
					ans=Math.abs(x-i);
					re = i;
				}
			}
		}
		System.out.println(re);
	} main {
		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		int n = sc.nextInt();
		int ans=102;
		int re=0;
		List<Integer> p = new ArrayList<Integer>();
		for(int i=0;i<n;i++) {
			p.add(sc.nextInt());
		}
		for(int i=101;i>=0;i--) {
			if(!p.contains(i)) {
				if(ans>=Math.abs(x-i)) {
					ans=Math.abs(x-i);
					re = i;
				}
			}
		}
		System.out.println(re);
	} 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 int ans=102; ans 102 int re=0; re 0 List<Integer> p = new ArrayList<Integer>(); p new ArrayList<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 for(int i=101;i>=0;i--) {
			if(!p.contains(i)) {
				if(ans>=Math.abs(x-i)) {
					ans=Math.abs(x-i);
					re = i;
				}
			}
		} int i=101; int i=101; i 101 i>=0 i 0 i-- i-- i {
			if(!p.contains(i)) {
				if(ans>=Math.abs(x-i)) {
					ans=Math.abs(x-i);
					re = i;
				}
			}
		} {
			if(!p.contains(i)) {
				if(ans>=Math.abs(x-i)) {
					ans=Math.abs(x-i);
					re = i;
				}
			}
		} if(!p.contains(i)) {
				if(ans>=Math.abs(x-i)) {
					ans=Math.abs(x-i);
					re = i;
				}
			} !p.contains(i) p.contains(i) p.contains p i {
				if(ans>=Math.abs(x-i)) {
					ans=Math.abs(x-i);
					re = i;
				}
			} if(ans>=Math.abs(x-i)) {
					ans=Math.abs(x-i);
					re = i;
				} ans>=Math.abs(x-i) ans Math.abs(x-i) Math.abs Math x-i x i {
					ans=Math.abs(x-i);
					re = i;
				} ans=Math.abs(x-i) ans Math.abs(x-i) Math.abs Math x-i x i re = i re i System.out.println(re) System.out.println System.out System System.out re 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();
		int ans=102;
		int re=0;
		List<Integer> p = new ArrayList<Integer>();
		for(int i=0;i<n;i++) {
			p.add(sc.nextInt());
		}
		for(int i=101;i>=0;i--) {
			if(!p.contains(i)) {
				if(ans>=Math.abs(x-i)) {
					ans=Math.abs(x-i);
					re = i;
				}
			}
		}
		System.out.println(re);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		int n = sc.nextInt();
		int ans=102;
		int re=0;
		List<Integer> p = new ArrayList<Integer>();
		for(int i=0;i<n;i++) {
			p.add(sc.nextInt());
		}
		for(int i=101;i>=0;i--) {
			if(!p.contains(i)) {
				if(ans>=Math.abs(x-i)) {
					ans=Math.abs(x-i);
					re = i;
				}
			}
		}
		System.out.println(re);
	}
} Main
import java.util.ArrayList;
import java.util.List;
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();
		int ans=102;
		int re=0;
		List<Integer> p = new ArrayList<Integer>();
		for(int i=0;i<n;i++) {
			p.add(sc.nextInt());
		}
		for(int i=101;i>=0;i--) {
			if(!p.contains(i)) {
				if(ans>=Math.abs(x-i)) {
					ans=Math.abs(x-i);
					re = i;
				}
			}
		}
		System.out.println(re);
	}
}