import java.util.ArrayList; import java.util.Scanner; public class No123 { public static void main(String[] args) { Scanner s = new Scanner(System.in); int n = s.nextInt() , m = s.nextInt(); ArrayList al = new ArrayList(); for(int i = 0;i < n;i++){ al.add(n - i); } for(int i = 0;i < m;i++){ int a = s.nextInt() , get = (int)al.get(n - a); al.remove(n - a); al.add(get); } System.out.println(al.get(n - 1)); } }