import sys sys.setrecursionlimit(1000000) n,q=map(int,input().split()) c=list(map(int,input().split())) def init(n): global seg global N N=1 while N < n: N <<= 1 seg=[0]*(N + N-1) def query(l, r): return _query(l, r, 0, 0, N) def _query(l, r, i, L, R): if l <= L and R <= r: return seg[i] if R<=l or r <= L: return 0 m=(L+R)//2 v1 = _query(l, r, i*2+1,L, m) v2 = _query(l, r, i*2+2, m, R) return v1 ^ v2 def update(i,x): j=i + N-1 seg[j]^=x while j > 0: j = (j - 1) // 2 seg[j] = seg[j*2+1]^seg[j*2+2] def rec(v, p, vs, g, l , r): l[v]=len(vs) vs.append(v) for nv in g[v]: if nv == p: continue rec(nv, v, vs, g, l, r) r[v]=len(vs) g= [[] for _ in range(n)] for _ in range(n-1): a,b=map(lambda x: int(x)-1, input().split()) g[a].append(b) g[b].append(a) vs = [] l = [0]*n r = [0]*n rec(0, -1, vs, g, l, r) init(len(vs)) for i in range(len(vs)): update(i, c[vs[i]]) for _ in range(q): t, x, y = map(int, input().split()) x-=1 if t==1: update(l[x], y) else: print(query(l[x], r[x]))