import 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();

        if(n==0) {
            System.out.print(x);
            return;
        }
        HashSet<Integer> set = new HashSet<>();

        for(int i=0; i<n; i++) {
            int num = sc.nextInt();
            set.add(num);
        }

        int abs = 101;
        int z = x;
        for(int i=0; i<=101; i++) {
            if(!set.contains(i)) {
                if (Math.abs(x-i) < abs) {
                    abs = Math.abs(x-i);
                    z = i;
                }
            }
        }
        System.out.print(z);
        return;
    }
} import java.util.*; util.* java public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        int n = sc.nextInt();

        if(n==0) {
            System.out.print(x);
            return;
        }
        HashSet<Integer> set = new HashSet<>();

        for(int i=0; i<n; i++) {
            int num = sc.nextInt();
            set.add(num);
        }

        int abs = 101;
        int z = x;
        for(int i=0; i<=101; i++) {
            if(!set.contains(i)) {
                if (Math.abs(x-i) < abs) {
                    abs = Math.abs(x-i);
                    z = i;
                }
            }
        }
        System.out.print(z);
        return;
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        int n = sc.nextInt();

        if(n==0) {
            System.out.print(x);
            return;
        }
        HashSet<Integer> set = new HashSet<>();

        for(int i=0; i<n; i++) {
            int num = sc.nextInt();
            set.add(num);
        }

        int abs = 101;
        int z = x;
        for(int i=0; i<=101; i++) {
            if(!set.contains(i)) {
                if (Math.abs(x-i) < abs) {
                    abs = Math.abs(x-i);
                    z = i;
                }
            }
        }
        System.out.print(z);
        return;
    } main {
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        int n = sc.nextInt();

        if(n==0) {
            System.out.print(x);
            return;
        }
        HashSet<Integer> set = new HashSet<>();

        for(int i=0; i<n; i++) {
            int num = sc.nextInt();
            set.add(num);
        }

        int abs = 101;
        int z = x;
        for(int i=0; i<=101; i++) {
            if(!set.contains(i)) {
                if (Math.abs(x-i) < abs) {
                    abs = Math.abs(x-i);
                    z = i;
                }
            }
        }
        System.out.print(z);
        return;
    } 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 if(n==0) {
            System.out.print(x);
            return;
        } n==0 n 0 {
            System.out.print(x);
            return;
        } System.out.print(x) System.out.print System.out System System.out x return; HashSet<Integer> set = new HashSet<>(); set new HashSet<>() for(int i=0; i<n; i++) {
            int num = sc.nextInt();
            set.add(num);
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            int num = sc.nextInt();
            set.add(num);
        } {
            int num = sc.nextInt();
            set.add(num);
        } int num = sc.nextInt(); num sc.nextInt() sc.nextInt sc set.add(num) set.add set num int abs = 101; abs 101 int z = x; z x for(int i=0; i<=101; i++) {
            if(!set.contains(i)) {
                if (Math.abs(x-i) < abs) {
                    abs = Math.abs(x-i);
                    z = i;
                }
            }
        } int i=0; int i=0; i 0 i<=101 i 101 i++ i++ i {
            if(!set.contains(i)) {
                if (Math.abs(x-i) < abs) {
                    abs = Math.abs(x-i);
                    z = i;
                }
            }
        } {
            if(!set.contains(i)) {
                if (Math.abs(x-i) < abs) {
                    abs = Math.abs(x-i);
                    z = i;
                }
            }
        } if(!set.contains(i)) {
                if (Math.abs(x-i) < abs) {
                    abs = Math.abs(x-i);
                    z = i;
                }
            } !set.contains(i) set.contains(i) set.contains set i {
                if (Math.abs(x-i) < abs) {
                    abs = Math.abs(x-i);
                    z = i;
                }
            } if (Math.abs(x-i) < abs) {
                    abs = Math.abs(x-i);
                    z = i;
                } Math.abs(x-i) < abs Math.abs(x-i) Math.abs Math x-i x i abs {
                    abs = Math.abs(x-i);
                    z = i;
                } abs = Math.abs(x-i) abs Math.abs(x-i) Math.abs Math x-i x i z = i z i System.out.print(z) System.out.print System.out System System.out z return; 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();

        if(n==0) {
            System.out.print(x);
            return;
        }
        HashSet<Integer> set = new HashSet<>();

        for(int i=0; i<n; i++) {
            int num = sc.nextInt();
            set.add(num);
        }

        int abs = 101;
        int z = x;
        for(int i=0; i<=101; i++) {
            if(!set.contains(i)) {
                if (Math.abs(x-i) < abs) {
                    abs = Math.abs(x-i);
                    z = i;
                }
            }
        }
        System.out.print(z);
        return;
    }
} public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        int n = sc.nextInt();

        if(n==0) {
            System.out.print(x);
            return;
        }
        HashSet<Integer> set = new HashSet<>();

        for(int i=0; i<n; i++) {
            int num = sc.nextInt();
            set.add(num);
        }

        int abs = 101;
        int z = x;
        for(int i=0; i<=101; i++) {
            if(!set.contains(i)) {
                if (Math.abs(x-i) < abs) {
                    abs = Math.abs(x-i);
                    z = i;
                }
            }
        }
        System.out.print(z);
        return;
    }
} Main
import 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();

        if(n==0) {
            System.out.print(x);
            return;
        }
        HashSet<Integer> set = new HashSet<>();

        for(int i=0; i<n; i++) {
            int num = sc.nextInt();
            set.add(num);
        }

        int abs = 101;
        int z = x;
        for(int i=0; i<=101; i++) {
            if(!set.contains(i)) {
                if (Math.abs(x-i) < abs) {
                    abs = Math.abs(x-i);
                    z = i;
                }
            }
        }
        System.out.print(z);
        return;
    }
}