print((function (f) local n,m,a = f(),f(),{} for i=1,n do a[i]=n+1-i end for _=1,m do local j=f() local t=a[n+1-j] for i=n+1-j,n-1 do a[i]=a[i+1] end a[n]=t end return a[n] end)((function () local M=require'ffi' local C,c=M.C,M.new("int[1]") M.cdef 'int scanf(const char*, ...);' return function () C.scanf("%d",c) return c[0] end end)()))