#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 1e4 + 1e3 + 1e2 + 1e1 + 1, K = 400;
vector<int> adj[N];
int SZ[N], HLDiD[N], P[N], DFSiD[N], ST[N], HEAD[N], CNT[N / K][N << 1],
    JM[N / K], RT[N / K], A[N], T[N], n, q, st, hldt, x;
bitset<N> STT;
void DFS(int u) {
  SZ[u] = 1;
  for (int x : adj[u]) {
    DFS(x);
    SZ[u] += SZ[x];
  }
}
void HLD(int u) {
  ST[u] = ++st;
  DFSiD[st] = u;
  HEAD[hldt] |= HEAD[hldt] ? 0 : u;
  HLDiD[u] = hldt;
  int arshd = 0;
  for (int x : adj[u])
    if (!arshd || SZ[x] > SZ[arshd]) arshd = x;
  if (arshd) HLD(arshd);
  for (int x : adj[u])
    if (x != arshd) {
      hldt++;
      HLD(x);
    }
}
void upd(int l, int r, int d) {
  int L = (l - 1) / K, R = (r - 1) / K;
  if (L == R)
    for (int i = l; i <= r; i++) {
      int u = DFSiD[i];
      if (!STT[u]) {
        CNT[L][A[u]]--;
        if (A[u] + JM[L] < n) RT[L]--;
      }
      A[u] += d;
      if (!STT[u]) {
        CNT[L][A[u]]++;
        if (A[u] + JM[L] < n) RT[L]++;
      }
    }
  if (L == R) return;
  for (int i = l; i <= (L + 1) * K; i++) {
    int u = DFSiD[i];
    if (!STT[u]) {
      CNT[L][A[u]]--;
      if (A[u] + JM[L] < n) RT[L]--;
    }
    A[u] += d;
    if (!STT[u]) {
      CNT[L][A[u]]++;
      if (A[u] + JM[L] < n) RT[L]++;
    }
  }
  for (int i = R * K + 1; i <= r; i++) {
    int u = DFSiD[i];
    if (!STT[u]) {
      CNT[R][A[u]]--;
      if (A[u] + JM[R] < n) RT[R]--;
    }
    A[u] += d;
    if (!STT[u]) {
      CNT[R][A[u]]++;
      if (A[u] + JM[R] < n) RT[R]++;
    }
  }
  for (int i = L + 1; i < R; i++) {
    if (d > 0)
      RT[i] -= CNT[i][n - JM[i] - 1];
    else
      RT[i] += CNT[i][n - JM[i]];
    JM[i] += d;
  }
}
int main() {
  scanf("%d %d", &n, &q);
  for (int i = 2; i <= n; i++) {
    scanf("%d", &P[i]);
    adj[P[i]].push_back(i);
  }
  for (int i = 1; i <= n; i++) scanf("%d", &T[i]);
  DFS(1);
  HLD(1);
  for (int i = 1; i <= n; i++) {
    int ln = (i - 1) / K, u = DFSiD[i];
    A[u] = T[u] + n;
    CNT[ln][A[u]]++;
  }
  for (int Q = 0; Q < q; Q++) {
    scanf("%d", &x);
    int u = abs(x);
    while (u > 0) {
      int v = HEAD[HLDiD[u]];
      if (x > 0)
        upd(ST[v], ST[u], -1);
      else
        upd(ST[v], ST[u], 1);
      u = P[v];
    }
    x = max(x, -1 * x);
    int ln = (ST[x] - 1) / K;
    if (!STT[x]) {
      CNT[ln][A[x]]--;
      if (A[x] + JM[ln] < n) RT[ln]--;
    } else {
      CNT[ln][A[x]]++;
      if (A[x] + JM[ln] < n) RT[ln]++;
    }
    STT[x] = 1 - STT[x];
    int rt = 0;
    for (int i = 0; i <= (n - 1) / K; i++) rt += RT[i];
    printf("%d ", rt);
  }
}
