func main() var n: int :: cui@inputInt() var m: int :: cui@inputInt() var num: []int :: lib@range(0, n, 1) for i(0, m - 1) var a: int :: cui@inputInt() var tmp: int :: num[a] for j(a - 1, 1, -1) do num[j + 1] :: num[j] end for do num[1] :: tmp end for var ans: int :: num[1] do cui@print("\{ans}\n") end func