#include <bits/stdc++.h>
#define fi first
#define se second
#define For(i, a, b) for (int i = (a); i <= (b); ++i)
#define ForD(i, a, b) for (int i = (a); i >= (b); --i)
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repD(i, n) for (int i = (n) - 1; i >= 0; --i)
#define coutE(x) {cout << x << '\n'; return;}
#define pb push_back
#define pf push_front
#define all(x) x.begin(), x.end()
#define bs binary_search
#define ub upper_bound
#define lb lower_bound
#define endl '\n'
#define db long double
#define ll long long
#define ii pair<int, int>
#define vi vector<int>
#define vii vector<ii>
#define int long long
using namespace std;
void file(string s){
if (s.empty()) return;
freopen((s + ".inp").c_str(), "r", stdin);
freopen((s + ".out").c_str(), "w", stdout);
}
template <class X, class Y>
bool minimize(X &x, Y y){
if (x > y){
x = y;
return 1;
}
return 0;
}
template <class X, class Y>
bool maximize(X &x, Y y){
if (x < y){
x = y;
return 1;
}
return 0;
}
mt19937_64 rng(time(0));
const int N = 1e6 + 5;
const int MOD = 1e9 + 7; //998244353;
const int INF = 1e9;
const long long LINF = 1e18;
const int dx[] = {1, 0, 0, -1};
const int dy[] = {0, 1, -1, 0};
int n, q, a[N];
vi g[N];
int in[N], out[N], timer, node[N];
struct SigmaTree{
int st[2 * N];
void build(){
For(i, 1, n) st[i + n - 1] = a[node[i]];
ForD(i, n - 1, 1) st[i] = st[i << 1] + st[i << 1 | 1];
}
void update(int p, int x){
p += n - 1;
st[p] = x;
while (p > 1){
st[p >> 1] = st[p] + st[p ^ 1];
p >>= 1;
}
}
int get(int l, int r){
l += n - 1; r += n - 1;
int res = 0;
while (l <= r){
if (l & 1) res += st[l++];
if (!(r & 1)) res += st[r--];
l >>= 1; r >>= 1;
}
return res;
}
} ST;
void dfs(int u, int prev = 0){
in[u] = ++timer;
node[timer] = u;
for (int v: g[u]) if (v != prev){
dfs(v, u);
}
out[u] = timer;
}
void solve(){
cin >> n >> q;
For(i, 1, n) cin >> a[i];
rep(i, n - 1){
int u, v; cin >> u >> v;
g[u].pb(v); g[v].pb(u);
}
dfs(1);
ST.build();
while (q--){
int t; cin >> t;
if (t == 1){
int s, x; cin >> s >> x;
ST.update(in[s], x);
}
else{
int s; cin >> s;
cout << ST.get(in[s], out[s]) << endl;
}
}
}
signed main(){
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
file("");
int T = 1;
//cin >> T;
while (T--) solve();
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CgojZGVmaW5lIGZpIGZpcnN0CiNkZWZpbmUgc2Ugc2Vjb25kCgojZGVmaW5lIEZvcihpLCBhLCBiKSBmb3IgKGludCBpID0gKGEpOyBpIDw9IChiKTsgKytpKQojZGVmaW5lIEZvckQoaSwgYSwgYikgZm9yIChpbnQgaSA9IChhKTsgaSA+PSAoYik7IC0taSkKI2RlZmluZSByZXAoaSwgbikgZm9yIChpbnQgaSA9IDA7IGkgPCAobik7ICsraSkKI2RlZmluZSByZXBEKGksIG4pIGZvciAoaW50IGkgPSAobikgLSAxOyBpID49IDA7IC0taSkKI2RlZmluZSBjb3V0RSh4KSB7Y291dCA8PCB4IDw8ICdcbic7IHJldHVybjt9CiNkZWZpbmUgcGIgcHVzaF9iYWNrCiNkZWZpbmUgcGYgcHVzaF9mcm9udAoKI2RlZmluZSBhbGwoeCkgeC5iZWdpbigpLCB4LmVuZCgpCiNkZWZpbmUgYnMgYmluYXJ5X3NlYXJjaAojZGVmaW5lIHViIHVwcGVyX2JvdW5kCiNkZWZpbmUgbGIgbG93ZXJfYm91bmQKCiNkZWZpbmUgZW5kbCAnXG4nCgojZGVmaW5lIGRiIGxvbmcgZG91YmxlCiNkZWZpbmUgbGwgbG9uZyBsb25nCiNkZWZpbmUgaWkgcGFpcjxpbnQsIGludD4KI2RlZmluZSB2aSB2ZWN0b3I8aW50PgojZGVmaW5lIHZpaSB2ZWN0b3I8aWk+CgojZGVmaW5lIGludCBsb25nIGxvbmcKCgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKdm9pZCBmaWxlKHN0cmlu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