#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target( \
    "sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#pragma GCC optimize("unroll-loops")
const int N = (int)1e5 + 7;
const int inf = (int)1e9 + 7;
const int mod = (int)1e9 + 7;
const long long linf = (long long)1e18 + 7;
const int dx[] = {-1, 0, 1, 0, 1, -1, -1, 1};
const int dy[] = {0, 1, 0, -1, 1, -1, 1, -1};
using namespace std;
int n, m;
int a[N];
vector<int> g[N];
int tmr;
int sz[N], tin[N], nxt[N], par[N];
void dfs_sz(int v) {
  sz[v] = 1;
  for (auto &to : g[v]) {
    dfs_sz(to);
    sz[v] += sz[to];
    if (sz[to] > sz[g[v][0]]) {
      swap(g[v][0], to);
    }
  }
}
void dfs(int v) {
  tin[v] = ++tmr;
  for (auto to : g[v]) {
    nxt[to] = (to == g[v][0] ? nxt[v] : to);
  }
  for (auto to : g[v]) {
    dfs(to);
  }
}
int cnt;
bool ok[N];
void go(int v, int x) {
  if (x == 1) {
    while (v) {
      int l = tin[nxt[v]], r = tin[v];
      for (int i = (l); i <= (r); i++) {
        a[i]++;
        cnt -= a[i] == 0;
      }
      v = par[nxt[v]];
    }
  } else {
    while (v) {
      int l = tin[nxt[v]], r = tin[v];
      for (int i = (l); i <= (r); i++) {
        cnt += a[i] == 0;
        a[i]--;
      }
      v = par[nxt[v]];
    }
  }
}
int main() {
  ios_base ::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> m;
  for (int i = (2); i <= (n); i++) {
    cin >> par[i];
    g[par[i]].push_back(i);
  }
  dfs_sz(1);
  nxt[1] = 1;
  dfs(1);
  for (int i = (1); i <= (n); i++) cin >> a[tin[i]];
  for (int i = (1); i <= (m); i++) {
    int v;
    cin >> v;
    if (v > 0) {
      if (a[tin[v]] < 0) --cnt;
      a[tin[v]] += inf;
      go(v, -1);
    } else {
      v = -v;
      a[tin[v]] -= inf;
      if (a[tin[v]] < 0) ++cnt;
      go(v, 1);
    }
    cout << cnt << ' ';
  }
  exit(0);
}
