#include<bits/stdc++.h>
using namespace std;
#define int long long
const int MAXN = 100010;
int n, m, a[MAXN], ans, size[MAXN], dep[MAXN], rt, maxn, inc[MAXN];
vector<int> cd[MAXN];
int dfs(int x, int fa) {
for(int i = 0; i < cd[x].size(); i ++) {
int u = cd[x][i];
if(u == fa) {
continue;
}
dep[u] = dep[x] + 1;
dfs(u, x);
}
}
signed main() {
freopen("dqzl.in", "r", stdin);
freopen("dqzl.out", "w", stdout);
cin >> n >> m;
for(int i = 1; i <= n; i ++) {
cin >> a[i];
}
for(int i = 1; i < n; i ++) {
int x, y;
cin >> x >> y;
inc[x] ++;
inc[y] ++;
cd[x].push_back(y);
cd[y].push_back(x);
}
for(int i = 1; i <= n; i ++) {
if(inc[i] > maxn) {
maxn = inc[i];
rt = i;
}
}
ans = 1e12;
for(int i = 1; i <= n; i ++) {
if(inc[i] == maxn) {
dep[i] = 0;
dfs(i, 0);
int sum = 0;
for(int i = 1; i <= n; i ++) {
sum += a[i] * dep[i];
}
ans = min(ans, sum);
break;
}
}
if(ans <= m) {
cout << ans;
}
else {
cout << "Poor Van";
}
return 0;
}