import sys input = sys.stdin.readline class FenwickTree: def __init__(self, size): self.data = [0] * (size + 1) self.size = size # i is exclusive def prefix_sum(self, i): s = 0 while i > 0: s ^= self.data[i] i -= i & -i return s def add(self, i, x): i += 1 while i <= self.size: self.data[i] ^= x i += i & -i def euler_tour(G, root): N = len(G) stack = [(root, -1, 1), (root, -1, 0)] et = [] first = [-1] * N last = [-1] * N k = 0 while stack: v, p, t = stack.pop() if t == 0: et.append(v) first[v] = k k += 1 for c in G[v]: if c != p: stack.append((c, v, 1)) stack.append((c, v, 0)) else: last[v] = k return et, first, last N, Q = map(int, input().split()) C = list(map(int, input().split())) 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) et, first, last = euler_tour(G, 0) ft = FenwickTree(N) for i in range(N): ft.add(first[i], C[i]) for _ in range(Q): T, x, y = map(int, input().split()) x -= 1 if T == 1: ft.add(first[x], y) else: print(ft.prefix_sum(last[x]) ^ ft.prefix_sum(first[x]))