from sys import stdin n, q, *indata = map(int, stdin.read().split()) c = [indata[i] for i in range(n)] g = [[] for i in range(n+1)] offset = n for i in range(n-1): s, t = indata[offset + 2*i],indata[offset + 2*i+1] g[s].append(t) g[t].append(s) offset += (n-1)*2 intime = [0 for i in range(n+1)] outtime = [0 for i in range(n+1)] que = [(1,0)] check = [False for i in range(n+1)] time = 1 while que: now, inout = que.pop() if inout == 0: intime[now] = time time += 1 check[now] = True que.append((now,1)) for i in g[now]: if not check[i]: que.append((i,0)) else: outtime[now] = time time += 1 n = n * 2 + 1 bitree = [0 for i in range(n+1)] def btadd(ind,x): global bitree while ind <= n: bitree[ind] = bitree[ind] ^ x ind += ind & (-ind) def btsum(ind): val = 0 while ind > 0: val = val ^ bitree[ind] ind -= ind & (-ind) return val for i in range(len(c)): btadd(outtime[i+1],c[i]) for i in range(q): t, x, y = indata[offset + 3*i],indata[offset + 3*i+1],indata[offset + 3*i+2] if t == 1: btadd(outtime[x],y) else: ans = btsum(outtime[x]) ^ btsum(intime[x]) print("{}".format(ans))