import java.util.Scanner;

/**
 * Main
 */
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.println(x);
            return;
        }
        int[] arr = new int[102];
        for (int i=0; i<n; i++) {
            int p = sc.nextInt();
            arr[p] = 1;
        }
        int min = 999, index = 0;
        for (int i=0; i<=101; i++) {
            if (arr[i] == 1) continue;
            int dif = Math.abs(x - i);
            if (dif < min) {
                min = dif;
                index = i;
            }
        }
        System.out.println(index);
    }
} 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();
        if (n == 0) {
            System.out.println(x);
            return;
        }
        int[] arr = new int[102];
        for (int i=0; i<n; i++) {
            int p = sc.nextInt();
            arr[p] = 1;
        }
        int min = 999, index = 0;
        for (int i=0; i<=101; i++) {
            if (arr[i] == 1) continue;
            int dif = Math.abs(x - i);
            if (dif < min) {
                min = dif;
                index = i;
            }
        }
        System.out.println(index);
    }
} 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.println(x);
            return;
        }
        int[] arr = new int[102];
        for (int i=0; i<n; i++) {
            int p = sc.nextInt();
            arr[p] = 1;
        }
        int min = 999, index = 0;
        for (int i=0; i<=101; i++) {
            if (arr[i] == 1) continue;
            int dif = Math.abs(x - i);
            if (dif < min) {
                min = dif;
                index = i;
            }
        }
        System.out.println(index);
    } main {
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        int n = sc.nextInt();
        if (n == 0) {
            System.out.println(x);
            return;
        }
        int[] arr = new int[102];
        for (int i=0; i<n; i++) {
            int p = sc.nextInt();
            arr[p] = 1;
        }
        int min = 999, index = 0;
        for (int i=0; i<=101; i++) {
            if (arr[i] == 1) continue;
            int dif = Math.abs(x - i);
            if (dif < min) {
                min = dif;
                index = i;
            }
        }
        System.out.println(index);
    } 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.println(x);
            return;
        } n == 0 n 0 {
            System.out.println(x);
            return;
        } System.out.println(x) System.out.println System.out System System.out x return; int[] arr = new int[102]; arr new int[102] 102 for (int i=0; i<n; i++) {
            int p = sc.nextInt();
            arr[p] = 1;
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            int p = sc.nextInt();
            arr[p] = 1;
        } {
            int p = sc.nextInt();
            arr[p] = 1;
        } int p = sc.nextInt(); p sc.nextInt() sc.nextInt sc arr[p] = 1 arr[p] arr p 1 int min = 999 min 999 index = 0; index 0 for (int i=0; i<=101; i++) {
            if (arr[i] == 1) continue;
            int dif = Math.abs(x - i);
            if (dif < min) {
                min = dif;
                index = i;
            }
        } int i=0; int i=0; i 0 i<=101 i 101 i++ i++ i {
            if (arr[i] == 1) continue;
            int dif = Math.abs(x - i);
            if (dif < min) {
                min = dif;
                index = i;
            }
        } {
            if (arr[i] == 1) continue;
            int dif = Math.abs(x - i);
            if (dif < min) {
                min = dif;
                index = i;
            }
        } if (arr[i] == 1) continue; arr[i] == 1 arr[i] arr i 1 continue; int dif = Math.abs(x - i); dif Math.abs(x - i) Math.abs Math x - i x i if (dif < min) {
                min = dif;
                index = i;
            } dif < min dif min {
                min = dif;
                index = i;
            } min = dif min dif index = i index i System.out.println(index) System.out.println System.out System System.out index 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.println(x);
            return;
        }
        int[] arr = new int[102];
        for (int i=0; i<n; i++) {
            int p = sc.nextInt();
            arr[p] = 1;
        }
        int min = 999, index = 0;
        for (int i=0; i<=101; i++) {
            if (arr[i] == 1) continue;
            int dif = Math.abs(x - i);
            if (dif < min) {
                min = dif;
                index = i;
            }
        }
        System.out.println(index);
    }
} 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.println(x);
            return;
        }
        int[] arr = new int[102];
        for (int i=0; i<n; i++) {
            int p = sc.nextInt();
            arr[p] = 1;
        }
        int min = 999, index = 0;
        for (int i=0; i<=101; i++) {
            if (arr[i] == 1) continue;
            int dif = Math.abs(x - i);
            if (dif < min) {
                min = dif;
                index = i;
            }
        }
        System.out.println(index);
    }
} Main
import java.util.Scanner;

/**
 * Main
 */
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.println(x);
            return;
        }
        int[] arr = new int[102];
        for (int i=0; i<n; i++) {
            int p = sc.nextInt();
            arr[p] = 1;
        }
        int min = 999, index = 0;
        for (int i=0; i<=101; i++) {
            if (arr[i] == 1) continue;
            int dif = Math.abs(x - i);
            if (dif < min) {
                min = dif;
                index = i;
            }
        }
        System.out.println(index);
    }
}