Once again, Su was caught sleeping in an algorithms class. This was the Yth time (The teacher lost track of Y). The teacher is very angry and decided to punish him and gave an extra assignment.
The assignment is as follows:
You are given a tree having N nodes rooted at 1. Each node is numbered from 1 to N. Each node contains a number Xi ∀ i∈[1,N]. You have to perform Q operations which are one among the 3 types mentioned below
The first line contains two space separated integers N and Q.
Next line contains N space separated integers, ith of them is value Xi.
Then follows N−1 lines, each containing two space separated integers A and B, denoting an undirected edge between nodes A and B.
Then follows Q lines, each line describing a query as given in the problem statement.
For each query of type 2 and type 3, print a single line containing the answer.
1≤N≤5∗105
1≤Q≤2∗105
1≤X[i]≤108
1≤α,β≤104
1≤V,A,B≤N
A≠B
M=1000000007
The given graph denotes an undirected tree rooted at 1.
Note : This problem has binary scoring. You will receive points only if you pass all test files successfully.