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.println(x);
            System.exit(0);
        }

        int[] p = new int[102];

        for(int i=0; i<n; i++) {
            p[sc.nextInt()] = 1;
        }

        int diff = 0;
        int comp = 0;
        int ans = 0;
        for(int i=0; i<=101; i++) {
            if(p[i] != 1) {
                diff = Math.abs(x-i);
                if(i == 0) comp = diff;
                if(comp > diff) {
                    comp = diff;
                    ans = i;
                }
            }

        }
        System.out.println(ans);
    }
} 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.println(x);
            System.exit(0);
        }

        int[] p = new int[102];

        for(int i=0; i<n; i++) {
            p[sc.nextInt()] = 1;
        }

        int diff = 0;
        int comp = 0;
        int ans = 0;
        for(int i=0; i<=101; i++) {
            if(p[i] != 1) {
                diff = Math.abs(x-i);
                if(i == 0) comp = diff;
                if(comp > diff) {
                    comp = diff;
                    ans = i;
                }
            }

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

        if(n == 0) {
            System.out.println(x);
            System.exit(0);
        }

        int[] p = new int[102];

        for(int i=0; i<n; i++) {
            p[sc.nextInt()] = 1;
        }

        int diff = 0;
        int comp = 0;
        int ans = 0;
        for(int i=0; i<=101; i++) {
            if(p[i] != 1) {
                diff = Math.abs(x-i);
                if(i == 0) comp = diff;
                if(comp > diff) {
                    comp = diff;
                    ans = i;
                }
            }

        }
        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);

        int x = sc.nextInt();
        int n = sc.nextInt();

        if(n == 0) {
            System.out.println(x);
            System.exit(0);
        }

        int[] p = new int[102];

        for(int i=0; i<n; i++) {
            p[sc.nextInt()] = 1;
        }

        int diff = 0;
        int comp = 0;
        int ans = 0;
        for(int i=0; i<=101; i++) {
            if(p[i] != 1) {
                diff = Math.abs(x-i);
                if(i == 0) comp = diff;
                if(comp > diff) {
                    comp = diff;
                    ans = i;
                }
            }

        }
        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 if(n == 0) {
            System.out.println(x);
            System.exit(0);
        } n == 0 n 0 {
            System.out.println(x);
            System.exit(0);
        } System.out.println(x) System.out.println System.out System System.out x System.exit(0) System.exit System 0 int[] p = new int[102]; p new int[102] 102 for(int i=0; i<n; i++) {
            p[sc.nextInt()] = 1;
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            p[sc.nextInt()] = 1;
        } {
            p[sc.nextInt()] = 1;
        } p[sc.nextInt()] = 1 p[sc.nextInt()] p sc.nextInt() sc.nextInt sc 1 int diff = 0; diff 0 int comp = 0; comp 0 int ans = 0; ans 0 for(int i=0; i<=101; i++) {
            if(p[i] != 1) {
                diff = Math.abs(x-i);
                if(i == 0) comp = diff;
                if(comp > diff) {
                    comp = diff;
                    ans = i;
                }
            }

        } int i=0; int i=0; i 0 i<=101 i 101 i++ i++ i {
            if(p[i] != 1) {
                diff = Math.abs(x-i);
                if(i == 0) comp = diff;
                if(comp > diff) {
                    comp = diff;
                    ans = i;
                }
            }

        } {
            if(p[i] != 1) {
                diff = Math.abs(x-i);
                if(i == 0) comp = diff;
                if(comp > diff) {
                    comp = diff;
                    ans = i;
                }
            }

        } if(p[i] != 1) {
                diff = Math.abs(x-i);
                if(i == 0) comp = diff;
                if(comp > diff) {
                    comp = diff;
                    ans = i;
                }
            } p[i] != 1 p[i] p i 1 {
                diff = Math.abs(x-i);
                if(i == 0) comp = diff;
                if(comp > diff) {
                    comp = diff;
                    ans = i;
                }
            } diff = Math.abs(x-i) diff Math.abs(x-i) Math.abs Math x-i x i if(i == 0) comp = diff; i == 0 i 0 comp = diff comp diff if(comp > diff) {
                    comp = diff;
                    ans = i;
                } comp > diff comp diff {
                    comp = diff;
                    ans = i;
                } comp = diff comp diff ans = i ans i 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();

        if(n == 0) {
            System.out.println(x);
            System.exit(0);
        }

        int[] p = new int[102];

        for(int i=0; i<n; i++) {
            p[sc.nextInt()] = 1;
        }

        int diff = 0;
        int comp = 0;
        int ans = 0;
        for(int i=0; i<=101; i++) {
            if(p[i] != 1) {
                diff = Math.abs(x-i);
                if(i == 0) comp = diff;
                if(comp > diff) {
                    comp = diff;
                    ans = i;
                }
            }

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

        if(n == 0) {
            System.out.println(x);
            System.exit(0);
        }

        int[] p = new int[102];

        for(int i=0; i<n; i++) {
            p[sc.nextInt()] = 1;
        }

        int diff = 0;
        int comp = 0;
        int ans = 0;
        for(int i=0; i<=101; i++) {
            if(p[i] != 1) {
                diff = Math.abs(x-i);
                if(i == 0) comp = diff;
                if(comp > diff) {
                    comp = diff;
                    ans = i;
                }
            }

        }
        System.out.println(ans);
    }
} 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.println(x);
            System.exit(0);
        }

        int[] p = new int[102];

        for(int i=0; i<n; i++) {
            p[sc.nextInt()] = 1;
        }

        int diff = 0;
        int comp = 0;
        int ans = 0;
        for(int i=0; i<=101; i++) {
            if(p[i] != 1) {
                diff = Math.abs(x-i);
                if(i == 0) comp = diff;
                if(comp > diff) {
                    comp = diff;
                    ans = i;
                }
            }

        }
        System.out.println(ans);
    }
}
