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 hako[] = new int[102];
		for(int i=0;i<102;i++) {
			hako[i]=0;
		}
		for(int i=0;i<n;i++) {
			int a = sc.nextInt();
			hako[a] = 1;
		}
		
		if(hako[x]==0) {
			System.out.println(x);
			return;
		}
		int up=x+1;
		int down=x-1;
		
		while(up<=101 && down>=0) {
			if(hako[down] == 0) {
				System.out.println(down);
				return;
			}
			if(hako[up] == 0) {
				System.out.println(up);
				return;
			}
			up++;
			down--;
		}
		while(up==102) {
			if(hako[down] == 0) {
				System.out.println(down);
				return;
			}
			down--;
		}
		while(down==-1) {
			if(hako[up] == 0) {
				System.out.println(up);
				return;
			}
			up++;
		}
		
		
	}
} 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 hako[] = new int[102];
		for(int i=0;i<102;i++) {
			hako[i]=0;
		}
		for(int i=0;i<n;i++) {
			int a = sc.nextInt();
			hako[a] = 1;
		}
		
		if(hako[x]==0) {
			System.out.println(x);
			return;
		}
		int up=x+1;
		int down=x-1;
		
		while(up<=101 && down>=0) {
			if(hako[down] == 0) {
				System.out.println(down);
				return;
			}
			if(hako[up] == 0) {
				System.out.println(up);
				return;
			}
			up++;
			down--;
		}
		while(up==102) {
			if(hako[down] == 0) {
				System.out.println(down);
				return;
			}
			down--;
		}
		while(down==-1) {
			if(hako[up] == 0) {
				System.out.println(up);
				return;
			}
			up++;
		}
		
		
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int x=sc.nextInt();
		int n=sc.nextInt();
		int hako[] = new int[102];
		for(int i=0;i<102;i++) {
			hako[i]=0;
		}
		for(int i=0;i<n;i++) {
			int a = sc.nextInt();
			hako[a] = 1;
		}
		
		if(hako[x]==0) {
			System.out.println(x);
			return;
		}
		int up=x+1;
		int down=x-1;
		
		while(up<=101 && down>=0) {
			if(hako[down] == 0) {
				System.out.println(down);
				return;
			}
			if(hako[up] == 0) {
				System.out.println(up);
				return;
			}
			up++;
			down--;
		}
		while(up==102) {
			if(hako[down] == 0) {
				System.out.println(down);
				return;
			}
			down--;
		}
		while(down==-1) {
			if(hako[up] == 0) {
				System.out.println(up);
				return;
			}
			up++;
		}
		
		
	} main {
		Scanner sc = new Scanner(System.in);
		int x=sc.nextInt();
		int n=sc.nextInt();
		int hako[] = new int[102];
		for(int i=0;i<102;i++) {
			hako[i]=0;
		}
		for(int i=0;i<n;i++) {
			int a = sc.nextInt();
			hako[a] = 1;
		}
		
		if(hako[x]==0) {
			System.out.println(x);
			return;
		}
		int up=x+1;
		int down=x-1;
		
		while(up<=101 && down>=0) {
			if(hako[down] == 0) {
				System.out.println(down);
				return;
			}
			if(hako[up] == 0) {
				System.out.println(up);
				return;
			}
			up++;
			down--;
		}
		while(up==102) {
			if(hako[down] == 0) {
				System.out.println(down);
				return;
			}
			down--;
		}
		while(down==-1) {
			if(hako[up] == 0) {
				System.out.println(up);
				return;
			}
			up++;
		}
		
		
	} 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 hako[] = new int[102]; hako new int[102] 102 for(int i=0;i<102;i++) {
			hako[i]=0;
		} int i=0; int i=0; i 0 i<102 i 102 i++ i++ i {
			hako[i]=0;
		} {
			hako[i]=0;
		} hako[i]=0 hako[i] hako i 0 for(int i=0;i<n;i++) {
			int a = sc.nextInt();
			hako[a] = 1;
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			int a = sc.nextInt();
			hako[a] = 1;
		} {
			int a = sc.nextInt();
			hako[a] = 1;
		} int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc hako[a] = 1 hako[a] hako a 1 if(hako[x]==0) {
			System.out.println(x);
			return;
		} hako[x]==0 hako[x] hako x 0 {
			System.out.println(x);
			return;
		} System.out.println(x) System.out.println System.out System System.out x return; int up=x+1; up x+1 x 1 int down=x-1; down x-1 x 1 while(up<=101 && down>=0) {
			if(hako[down] == 0) {
				System.out.println(down);
				return;
			}
			if(hako[up] == 0) {
				System.out.println(up);
				return;
			}
			up++;
			down--;
		} up<=101 && down>=0 up<=101 up 101 down>=0 down 0 {
			if(hako[down] == 0) {
				System.out.println(down);
				return;
			}
			if(hako[up] == 0) {
				System.out.println(up);
				return;
			}
			up++;
			down--;
		} if(hako[down] == 0) {
				System.out.println(down);
				return;
			} hako[down] == 0 hako[down] hako down 0 {
				System.out.println(down);
				return;
			} System.out.println(down) System.out.println System.out System System.out down return; if(hako[up] == 0) {
				System.out.println(up);
				return;
			} hako[up] == 0 hako[up] hako up 0 {
				System.out.println(up);
				return;
			} System.out.println(up) System.out.println System.out System System.out up return; up++ up down-- down while(up==102) {
			if(hako[down] == 0) {
				System.out.println(down);
				return;
			}
			down--;
		} up==102 up 102 {
			if(hako[down] == 0) {
				System.out.println(down);
				return;
			}
			down--;
		} if(hako[down] == 0) {
				System.out.println(down);
				return;
			} hako[down] == 0 hako[down] hako down 0 {
				System.out.println(down);
				return;
			} System.out.println(down) System.out.println System.out System System.out down return; down-- down while(down==-1) {
			if(hako[up] == 0) {
				System.out.println(up);
				return;
			}
			up++;
		} down==-1 down -1 1 {
			if(hako[up] == 0) {
				System.out.println(up);
				return;
			}
			up++;
		} if(hako[up] == 0) {
				System.out.println(up);
				return;
			} hako[up] == 0 hako[up] hako up 0 {
				System.out.println(up);
				return;
			} System.out.println(up) System.out.println System.out System System.out up return; up++ up 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 hako[] = new int[102];
		for(int i=0;i<102;i++) {
			hako[i]=0;
		}
		for(int i=0;i<n;i++) {
			int a = sc.nextInt();
			hako[a] = 1;
		}
		
		if(hako[x]==0) {
			System.out.println(x);
			return;
		}
		int up=x+1;
		int down=x-1;
		
		while(up<=101 && down>=0) {
			if(hako[down] == 0) {
				System.out.println(down);
				return;
			}
			if(hako[up] == 0) {
				System.out.println(up);
				return;
			}
			up++;
			down--;
		}
		while(up==102) {
			if(hako[down] == 0) {
				System.out.println(down);
				return;
			}
			down--;
		}
		while(down==-1) {
			if(hako[up] == 0) {
				System.out.println(up);
				return;
			}
			up++;
		}
		
		
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int x=sc.nextInt();
		int n=sc.nextInt();
		int hako[] = new int[102];
		for(int i=0;i<102;i++) {
			hako[i]=0;
		}
		for(int i=0;i<n;i++) {
			int a = sc.nextInt();
			hako[a] = 1;
		}
		
		if(hako[x]==0) {
			System.out.println(x);
			return;
		}
		int up=x+1;
		int down=x-1;
		
		while(up<=101 && down>=0) {
			if(hako[down] == 0) {
				System.out.println(down);
				return;
			}
			if(hako[up] == 0) {
				System.out.println(up);
				return;
			}
			up++;
			down--;
		}
		while(up==102) {
			if(hako[down] == 0) {
				System.out.println(down);
				return;
			}
			down--;
		}
		while(down==-1) {
			if(hako[up] == 0) {
				System.out.println(up);
				return;
			}
			up++;
		}
		
		
	}
} Main
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 hako[] = new int[102];
		for(int i=0;i<102;i++) {
			hako[i]=0;
		}
		for(int i=0;i<n;i++) {
			int a = sc.nextInt();
			hako[a] = 1;
		}
		
		if(hako[x]==0) {
			System.out.println(x);
			return;
		}
		int up=x+1;
		int down=x-1;
		
		while(up<=101 && down>=0) {
			if(hako[down] == 0) {
				System.out.println(down);
				return;
			}
			if(hako[up] == 0) {
				System.out.println(up);
				return;
			}
			up++;
			down--;
		}
		while(up==102) {
			if(hako[down] == 0) {
				System.out.println(down);
				return;
			}
			down--;
		}
		while(down==-1) {
			if(hako[up] == 0) {
				System.out.println(up);
				return;
			}
			up++;
		}
		
		
	}
}
