#include <bits/stdc++.h>
using namespace std;
using K = long double;
using ll = long long;
const int N = 100005;
const int B = 500;
int n, m, par[N], t[N], ver[N];
vector<int> g[N];
int result = 0;
int size;
vector<int> bucket[N];
int mark[N], used[N], timer = 1;
int bck, buck[N], shift[N], nxt[N];
int val[N], vac[N];
void createBucket(int v) {
  bucket[bck].assign(2 * size + 1, 0);
  shift[bck] = size;
  while (v >= 0 && mark[v] != timer) {
    used[v] = timer;
    buck[v] = bck;
    if (!vac[v]) {
      if (val[v] <= size && val[v] >= -size) {
        ++bucket[bck][val[v] + size];
      }
    }
    v = par[v];
  }
  nxt[bck] = v;
  ++bck;
}
int dfs(int v) {
  int cnt = (mark[v] == timer);
  for (auto& to : g[v]) {
    cnt += dfs(to);
  }
  if (cnt > 1) mark[v] = timer;
  return cnt > 0;
}
void buckets(int v) {
  for (auto& to : g[v]) {
    buckets(to);
  }
  if (par[v] >= 0 && mark[v] == timer && mark[par[v]] != timer &&
      used[par[v]] != timer) {
    createBucket(par[v]);
  }
}
void rebuild(int pos) {
  for (int v = 0; v < (n); ++v)
    if (used[v] == timer) val[v] -= (shift[buck[v]] - size);
  ++timer;
  bck = 0;
  size = min(m - pos, B);
  for (int i = pos; i < pos + size; ++i) {
    mark[abs(ver[i]) - 1] = timer;
  }
  dfs(0);
  buckets(0);
}
void update(int v, int add) {
  if (val[v] < 0) {
    result += vac[v] ? +1 : -1;
  }
  vac[v] ^= 1;
  v = par[v];
  while (v >= 0) {
    if (mark[v] == timer) {
      if (!vac[v]) {
        if (val[v] == 0 && add < 0) ++result;
        if (val[v] == -1 && add > 0) --result;
      }
      val[v] += add;
      v = par[v];
      continue;
    }
    int b = buck[v];
    if (add < 0) {
      result += bucket[b][shift[b]];
      shift[b] -= add;
    } else {
      shift[b] -= add;
      result -= bucket[b][shift[b]];
    }
    v = nxt[b];
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cin >> n >> m;
  par[0] = -1;
  for (int i = 1; i < n; ++i) {
    int p;
    cin >> p;
    --p;
    par[i] = p;
    g[p].push_back(i);
  }
  for (int i = 0; i < (n); ++i) cin >> t[i], val[i] = t[i];
  for (int i = 0; i < (m); ++i) cin >> ver[i];
  for (int i = 0; i < (m); ++i) {
    if (i % B == 0) {
      rebuild(i);
    }
    int v = ver[i];
    update(abs(v) - 1, v < 0 ? +1 : -1);
    cout << result << ' ';
  }
  cout << '\n';
  return 0;
}
