import java.util.*; public class Run { public static void main (String arg[]) { Scanner scan = new Scanner(System.in); int N = scan.nextInt(); ArrayList C = new ArrayList<>(); for (int i = 0; i < N; i++) C.add(i+1); int M = scan.nextInt(); int A; for (int i = 0; i < M; i++) { A = scan.nextInt(); if (A!=1) { C.add(0, C.get(A - 1)); C.remove(A); } } System.out.println(C.get(0)); } }