import java.io.BufferedReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Set;
import java.util.StringTokenizer;

public class Main {
    
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new java.io.InputStreamReader(System.in));
        PrintWriter pw = new PrintWriter(System.out);
        StringTokenizer st = new StringTokenizer(br.readLine());

        int X = Integer.parseInt(st.nextToken());
        int N = Integer.parseInt(st.nextToken());

        if(N == 0) {
            pw.println(X);
            br.close();
            pw.close();
            return;
        }

        String[] input_array = br.readLine().split(" ");

        Set<Integer> checkSet = new HashSet<>();

        for(String str : input_array) {
            checkSet.add(Integer.parseInt(str));
        }

        int up = X;
        int down = X;
        int increment = 1;

        if(!checkSet.contains(X)) {
            pw.println(X);
            br.close();
            pw.close();
            return;
        }

        while(up != 100 || down != 0) {
            up += increment;
            down -= increment;

            if(!checkSet.contains(down)) {
                pw.println(down);
                break;
            } else if(!checkSet.contains(up)) {
                pw.println(up);
                break;
            }
        } 

        br.close();
        pw.close();
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.PrintWriter; PrintWriter java.io import java.util.HashSet; HashSet java.util import java.util.Set; Set java.util import java.util.StringTokenizer; StringTokenizer java.util public class Main {
    
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new java.io.InputStreamReader(System.in));
        PrintWriter pw = new PrintWriter(System.out);
        StringTokenizer st = new StringTokenizer(br.readLine());

        int X = Integer.parseInt(st.nextToken());
        int N = Integer.parseInt(st.nextToken());

        if(N == 0) {
            pw.println(X);
            br.close();
            pw.close();
            return;
        }

        String[] input_array = br.readLine().split(" ");

        Set<Integer> checkSet = new HashSet<>();

        for(String str : input_array) {
            checkSet.add(Integer.parseInt(str));
        }

        int up = X;
        int down = X;
        int increment = 1;

        if(!checkSet.contains(X)) {
            pw.println(X);
            br.close();
            pw.close();
            return;
        }

        while(up != 100 || down != 0) {
            up += increment;
            down -= increment;

            if(!checkSet.contains(down)) {
                pw.println(down);
                break;
            } else if(!checkSet.contains(up)) {
                pw.println(up);
                break;
            }
        } 

        br.close();
        pw.close();
    }
} Main public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new java.io.InputStreamReader(System.in));
        PrintWriter pw = new PrintWriter(System.out);
        StringTokenizer st = new StringTokenizer(br.readLine());

        int X = Integer.parseInt(st.nextToken());
        int N = Integer.parseInt(st.nextToken());

        if(N == 0) {
            pw.println(X);
            br.close();
            pw.close();
            return;
        }

        String[] input_array = br.readLine().split(" ");

        Set<Integer> checkSet = new HashSet<>();

        for(String str : input_array) {
            checkSet.add(Integer.parseInt(str));
        }

        int up = X;
        int down = X;
        int increment = 1;

        if(!checkSet.contains(X)) {
            pw.println(X);
            br.close();
            pw.close();
            return;
        }

        while(up != 100 || down != 0) {
            up += increment;
            down -= increment;

            if(!checkSet.contains(down)) {
                pw.println(down);
                break;
            } else if(!checkSet.contains(up)) {
                pw.println(up);
                break;
            }
        } 

        br.close();
        pw.close();
    } main {
        BufferedReader br = new BufferedReader(new java.io.InputStreamReader(System.in));
        PrintWriter pw = new PrintWriter(System.out);
        StringTokenizer st = new StringTokenizer(br.readLine());

        int X = Integer.parseInt(st.nextToken());
        int N = Integer.parseInt(st.nextToken());

        if(N == 0) {
            pw.println(X);
            br.close();
            pw.close();
            return;
        }

        String[] input_array = br.readLine().split(" ");

        Set<Integer> checkSet = new HashSet<>();

        for(String str : input_array) {
            checkSet.add(Integer.parseInt(str));
        }

        int up = X;
        int down = X;
        int increment = 1;

        if(!checkSet.contains(X)) {
            pw.println(X);
            br.close();
            pw.close();
            return;
        }

        while(up != 100 || down != 0) {
            up += increment;
            down -= increment;

            if(!checkSet.contains(down)) {
                pw.println(down);
                break;
            } else if(!checkSet.contains(up)) {
                pw.println(up);
                break;
            }
        } 

        br.close();
        pw.close();
    } BufferedReader br = new BufferedReader(new java.io.InputStreamReader(System.in)); br new BufferedReader(new java.io.InputStreamReader(System.in)) PrintWriter pw = new PrintWriter(System.out); pw new PrintWriter(System.out) StringTokenizer st = new StringTokenizer(br.readLine()); st new StringTokenizer(br.readLine()) int X = Integer.parseInt(st.nextToken()); X Integer.parseInt(st.nextToken()) Integer.parseInt Integer st.nextToken() st.nextToken st int N = Integer.parseInt(st.nextToken()); N Integer.parseInt(st.nextToken()) Integer.parseInt Integer st.nextToken() st.nextToken st if(N == 0) {
            pw.println(X);
            br.close();
            pw.close();
            return;
        } N == 0 N 0 {
            pw.println(X);
            br.close();
            pw.close();
            return;
        } pw.println(X) pw.println pw X br.close() br.close br pw.close() pw.close pw return; String[] input_array = br.readLine().split(" "); input_array br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " Set<Integer> checkSet = new HashSet<>(); checkSet new HashSet<>() for(String str : input_array) {
            checkSet.add(Integer.parseInt(str));
        } String str input_array {
            checkSet.add(Integer.parseInt(str));
        } {
            checkSet.add(Integer.parseInt(str));
        } checkSet.add(Integer.parseInt(str)) checkSet.add checkSet Integer.parseInt(str) Integer.parseInt Integer str int up = X; up X int down = X; down X int increment = 1; increment 1 if(!checkSet.contains(X)) {
            pw.println(X);
            br.close();
            pw.close();
            return;
        } !checkSet.contains(X) checkSet.contains(X) checkSet.contains checkSet X {
            pw.println(X);
            br.close();
            pw.close();
            return;
        } pw.println(X) pw.println pw X br.close() br.close br pw.close() pw.close pw return; while(up != 100 || down != 0) {
            up += increment;
            down -= increment;

            if(!checkSet.contains(down)) {
                pw.println(down);
                break;
            } else if(!checkSet.contains(up)) {
                pw.println(up);
                break;
            }
        } up != 100 || down != 0 up != 100 up 100 down != 0 down 0 {
            up += increment;
            down -= increment;

            if(!checkSet.contains(down)) {
                pw.println(down);
                break;
            } else if(!checkSet.contains(up)) {
                pw.println(up);
                break;
            }
        } up += increment up increment down -= increment down increment if(!checkSet.contains(down)) {
                pw.println(down);
                break;
            } else if(!checkSet.contains(up)) {
                pw.println(up);
                break;
            } !checkSet.contains(down) checkSet.contains(down) checkSet.contains checkSet down {
                pw.println(down);
                break;
            } pw.println(down) pw.println pw down break; if(!checkSet.contains(up)) {
                pw.println(up);
                break;
            } !checkSet.contains(up) checkSet.contains(up) checkSet.contains checkSet up {
                pw.println(up);
                break;
            } pw.println(up) pw.println pw up break; br.close() br.close br pw.close() pw.close pw String[] args args public class Main {
    
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new java.io.InputStreamReader(System.in));
        PrintWriter pw = new PrintWriter(System.out);
        StringTokenizer st = new StringTokenizer(br.readLine());

        int X = Integer.parseInt(st.nextToken());
        int N = Integer.parseInt(st.nextToken());

        if(N == 0) {
            pw.println(X);
            br.close();
            pw.close();
            return;
        }

        String[] input_array = br.readLine().split(" ");

        Set<Integer> checkSet = new HashSet<>();

        for(String str : input_array) {
            checkSet.add(Integer.parseInt(str));
        }

        int up = X;
        int down = X;
        int increment = 1;

        if(!checkSet.contains(X)) {
            pw.println(X);
            br.close();
            pw.close();
            return;
        }

        while(up != 100 || down != 0) {
            up += increment;
            down -= increment;

            if(!checkSet.contains(down)) {
                pw.println(down);
                break;
            } else if(!checkSet.contains(up)) {
                pw.println(up);
                break;
            }
        } 

        br.close();
        pw.close();
    }
} public class Main {
    
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new java.io.InputStreamReader(System.in));
        PrintWriter pw = new PrintWriter(System.out);
        StringTokenizer st = new StringTokenizer(br.readLine());

        int X = Integer.parseInt(st.nextToken());
        int N = Integer.parseInt(st.nextToken());

        if(N == 0) {
            pw.println(X);
            br.close();
            pw.close();
            return;
        }

        String[] input_array = br.readLine().split(" ");

        Set<Integer> checkSet = new HashSet<>();

        for(String str : input_array) {
            checkSet.add(Integer.parseInt(str));
        }

        int up = X;
        int down = X;
        int increment = 1;

        if(!checkSet.contains(X)) {
            pw.println(X);
            br.close();
            pw.close();
            return;
        }

        while(up != 100 || down != 0) {
            up += increment;
            down -= increment;

            if(!checkSet.contains(down)) {
                pw.println(down);
                break;
            } else if(!checkSet.contains(up)) {
                pw.println(up);
                break;
            }
        } 

        br.close();
        pw.close();
    }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Set;
import java.util.StringTokenizer;

public class Main {
    
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new java.io.InputStreamReader(System.in));
        PrintWriter pw = new PrintWriter(System.out);
        StringTokenizer st = new StringTokenizer(br.readLine());

        int X = Integer.parseInt(st.nextToken());
        int N = Integer.parseInt(st.nextToken());

        if(N == 0) {
            pw.println(X);
            br.close();
            pw.close();
            return;
        }

        String[] input_array = br.readLine().split(" ");

        Set<Integer> checkSet = new HashSet<>();

        for(String str : input_array) {
            checkSet.add(Integer.parseInt(str));
        }

        int up = X;
        int down = X;
        int increment = 1;

        if(!checkSet.contains(X)) {
            pw.println(X);
            br.close();
            pw.close();
            return;
        }

        while(up != 100 || down != 0) {
            up += increment;
            down -= increment;

            if(!checkSet.contains(down)) {
                pw.println(down);
                break;
            } else if(!checkSet.contains(up)) {
                pw.println(up);
                break;
            }
        } 

        br.close();
        pw.close();
    }
}