#include <bits/stdc++.h>
using namespace std;
inline void read(int &x) {
  int flg = 1;
  char ch;
  while (!isdigit(ch = getchar()))
    if (ch == '-') flg = -flg;
  for (x = ch - '0'; isdigit(ch = getchar()); x = x * 10 + ch - '0')
    ;
  x *= flg;
}
const int SQR = 205;
const int MAXN = 100005;
int n, B, fa[MAXN], tmr, dfn[MAXN], a[MAXN], tag[SQR], sum[SQR][MAXN << 1],
    L[SQR], R[SQR], O;
vector<int> e[MAXN];
int dep[MAXN], son[MAXN], sz[MAXN], top[MAXN];
void dfs(int u) {
  dep[u] = dep[fa[u]] + (sz[u] = 1);
  for (auto v : e[u]) {
    dfs(v), sz[u] += sz[v];
    if (sz[v] > sz[son[u]]) son[u] = v;
  }
}
void dfs2(int u, int tp) {
  top[u] = tp;
  dfn[u] = ++tmr;
  if (son[u]) dfs2(son[u], tp);
  for (auto v : e[u])
    if (v != son[u]) dfs2(v, v);
}
inline int bel(int x) { return (x - 1) / B + 1; }
int ans;
bool col[MAXN];
void ins(int x) {
  col[x] = 0;
  if (a[x] + tag[bel(x)] > 0) ++ans;
  ++sum[bel(x)][O + a[x]];
}
void del(int x) {
  col[x] = 1;
  if (a[x] + tag[bel(x)] > 0) --ans;
  --sum[bel(x)][O + a[x]];
}
void add(int l, int r) {
  if (bel(l) == bel(r)) {
    for (int i = l, x = bel(l); i <= r; ++i)
      if (!col[i]) {
        --sum[x][O + a[i]];
        ++sum[x][O + (++a[i])];
        if (tag[x] + a[i] == 1) ++ans;
      } else
        ++a[i];
    return;
  }
  int bl = bel(l), br = bel(r);
  for (int i = l, x = bl; i <= R[bl]; ++i)
    if (!col[i]) {
      --sum[x][O + a[i]];
      ++sum[x][O + (++a[i])];
      if (tag[x] + a[i] == 1) ++ans;
    } else
      ++a[i];
  for (int i = L[br], x = br; i <= r; ++i)
    if (!col[i]) {
      --sum[x][O + a[i]];
      ++sum[x][O + (++a[i])];
      if (tag[x] + a[i] == 1) ++ans;
    } else
      ++a[i];
  for (int i = bl + 1; i < br; ++i) {
    ++tag[i];
    ans += sum[i][O - tag[i] + 1];
  }
}
void sub(int l, int r) {
  if (bel(l) == bel(r)) {
    for (int i = l, x = bel(l); i <= r; ++i)
      if (!col[i]) {
        --sum[x][O + a[i]];
        ++sum[x][O + (--a[i])];
        if (tag[x] + a[i] == 0) --ans;
      } else
        --a[i];
    return;
  }
  int bl = bel(l), br = bel(r);
  for (int i = l, x = bl; i <= R[bl]; ++i)
    if (!col[i]) {
      --sum[x][O + a[i]];
      ++sum[x][O + (--a[i])];
      if (tag[x] + a[i] == 0) --ans;
    } else
      --a[i];
  for (int i = L[br], x = br; i <= r; ++i)
    if (!col[i]) {
      --sum[x][O + a[i]];
      ++sum[x][O + (--a[i])];
      if (tag[x] + a[i] == 0) --ans;
    } else
      --a[i];
  for (int i = bl + 1; i < br; ++i) {
    --tag[i];
    ans -= sum[i][O - tag[i]];
  }
}
void upd(int x, int v) {
  while (x)
    (v > 0 ? add(dfn[top[x]], dfn[x]) : sub(dfn[top[x]], dfn[x])),
        x = fa[top[x]];
}
int main() {
  int Q;
  read(n), read(Q);
  B = 500;
  O = n;
  for (int i = 2; i <= n; ++i) read(fa[i]), e[fa[i]].push_back(i);
  dfs(1), dfs2(1, 1);
  for (int i = 1; i <= n; ++i) {
    read(a[dfn[i]]), a[dfn[i]] = -a[dfn[i]];
    ++sum[bel(dfn[i])][O + a[dfn[i]]];
  }
  for (int i = 1; i <= bel(n); ++i) {
    L[i] = (i - 1) * B + 1;
    R[i] = min(n, i * B);
  }
  int k;
  while (Q--) {
    read(k);
    if (k > 0)
      upd(k, 1), del(dfn[k]);
    else
      upd(-k, -1), ins(dfn[-k]);
    printf("%d ", ans);
  }
}
