#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
struct edge {
  int to, nxt;
} e[N];
bool col[N];
int n, m, fa[N], head[N], cnt, dfn[N], idx, top[N], sz[N], son[N], dep[N],
    bel[N], idfn[N], tail[N];
int t[N];
int all, blocks;
vector<int> tmp;
int tot[600005];
struct Block {
  int L, R, len, tag;
  vector<int> a;
  vector<pair<int, int> > b;
  int it, ans;
  void re() {
    tmp = a;
    sort(tmp.begin(), tmp.end());
    b.clear();
    int v = tmp[0], x = 1;
    for (int i = 1; i < tmp.size(); ++i)
      if (tmp[i] != v)
        b.push_back(make_pair(v, x)), x = 1, v = tmp[i];
      else
        ++x;
    b.push_back(make_pair(v, x));
    for (int i = 1; i < b.size(); ++i) b[i].second += b[i - 1].second;
    it = upper_bound(b.begin(), b.end(), make_pair(-tag, 0x3fffffff)) -
         b.begin();
    ans = it ? b[it - 1].second : 0;
  }
  void init(int l, int r) {
    L = l, R = r;
    for (int i = l; i <= r; ++i) a.push_back(t[idfn[i]]);
    re();
  }
  void _erase(int val) {
    vector<pair<int, int> >::iterator pos =
        lower_bound(b.begin(), b.end(), make_pair(val, 0));
    for (vector<pair<int, int> >::iterator i = pos + 1; i < b.end(); ++i)
      --i->second;
    --pos->second;
    if ((pos == b.begin() && !pos->second) || pos->second == (pos - 1)->second)
      b.erase(pos);
  }
  void _insert(int val) {
    vector<pair<int, int> >::iterator pos =
        lower_bound(b.begin(), b.end(), make_pair(val, 0));
    for (vector<pair<int, int> >::iterator i = pos; i < b.end(); ++i)
      ++i->second;
    if (pos == b.end() || pos->first != val) {
      int ct = (pos == b.begin() ? 1 : (pos - 1)->second + 1);
      b.insert(pos, make_pair(val, ct));
    }
  }
  void add(int id, int x) {
    all -= ans;
    id = id - L;
    _erase(a[id]);
    _insert(a[id] += x);
    it = upper_bound(b.begin(), b.end(), make_pair(-tag, 0x3fffffff)) -
         b.begin();
    ans = it ? b[it - 1].second : 0;
    all += ans;
  }
  void dec(int l, int r) {
    all -= ans;
    l = max(l, L), r = min(r, R);
    if (L == l && r == R) {
      --tag;
      if (it < b.size() && b[it].first + tag <= 0) ++it;
      ans = it ? b[it - 1].second : 0;
      all += ans;
      return;
    } else {
      static pair<int, int> t1[N], t2[N];
      int top1 = 0, top2 = 0;
      for (int i = l; i <= r; ++i) {
        int& x = a[i - L];
        ++tot[200001 + x];
        --x;
      }
      for (int i = b.size() - 1; i; --i) b[i].second -= b[i - 1].second;
      for (int i = 0; i < b.size(); ++i)
        if (tot[200001 + b[i].first]) {
          int& x = tot[200001 + b[i].first];
          t1[++top1] = make_pair(b[i].first - 1, x);
          b[i].second -= x, x = 0;
        }
      int it1 = 0, it2 = 1;
      while (it1 < b.size() && it2 <= top1)
        if (b[it1].first == t1[it2].first) {
          int x = b[it1].second + t1[it2].second;
          if (x) t2[++top2] = make_pair(b[it1].first, x);
          ++it1, ++it2;
        } else if (b[it1].first < t1[it2].first) {
          int x = b[it1].second;
          if (x) t2[++top2] = make_pair(b[it1].first, x);
          ++it1;
        } else {
          int x = t1[it2].second;
          if (x) t2[++top2] = make_pair(t1[it2].first, x);
          ++it2;
        }
      while (it1 < b.size()) {
        int x = b[it1].second;
        if (x) t2[++top2] = make_pair(b[it1].first, x);
        ++it1;
      }
      while (it2 <= top1) {
        int x = t1[it2].second;
        if (x) t2[++top2] = make_pair(t1[it2].first, x);
        ++it2;
      }
      b.clear();
      for (int i = 1; i <= top2; ++i)
        t2[i].second += t2[i - 1].second, b.push_back(t2[i]);
      it = upper_bound(b.begin(), b.end(), make_pair(-tag, 0x3fffffff)) -
           b.begin();
      ans = it ? b[it - 1].second : 0;
      all += ans;
    }
  }
  void inc(int l, int r) {
    all -= ans;
    l = max(l, L), r = min(r, R);
    if (L == l && r == R) {
      ++tag;
      if (it && b[it - 1].first + tag > 0) --it;
      ans = it ? b[it - 1].second : 0;
      all += ans;
      return;
    } else {
      static pair<int, int> t1[N], t2[N];
      int top1 = 0, top2 = 0;
      for (int i = l; i <= r; ++i) {
        int& x = a[i - L];
        ++tot[200001 + x];
        ++x;
      }
      for (int i = b.size() - 1; i; --i) b[i].second -= b[i - 1].second;
      for (int i = 0; i < b.size(); ++i)
        if (tot[200001 + b[i].first]) {
          int& x = tot[200001 + b[i].first];
          t1[++top1] = make_pair(b[i].first + 1, x);
          b[i].second -= x, x = 0;
        }
      int it1 = 0, it2 = 1;
      while (it1 < b.size() && it2 <= top1)
        if (b[it1].first == t1[it2].first) {
          int x = b[it1].second + t1[it2].second;
          if (x) t2[++top2] = make_pair(b[it1].first, x);
          ++it1, ++it2;
        } else if (b[it1].first < t1[it2].first) {
          int x = b[it1].second;
          if (x) t2[++top2] = make_pair(b[it1].first, x);
          ++it1;
        } else {
          int x = t1[it2].second;
          if (x) t2[++top2] = make_pair(t1[it2].first, x);
          ++it2;
        }
      while (it1 < b.size()) {
        int x = b[it1].second;
        if (x) t2[++top2] = make_pair(b[it1].first, x);
        ++it1;
      }
      while (it2 <= top1) {
        int x = t1[it2].second;
        if (x) t2[++top2] = make_pair(t1[it2].first, x);
        ++it2;
      }
      b.clear();
      for (int i = 1; i <= top2; ++i)
        t2[i].second += t2[i - 1].second, b.push_back(t2[i]);
      it = upper_bound(b.begin(), b.end(), make_pair(-tag, 0x3fffffff)) -
           b.begin();
      ans = it ? b[it - 1].second : 0;
      all += ans;
    }
  }
} G[N];
void dfs(int now) {
  sz[now] = 1, son[now] = 0;
  for (int i = head[now]; i; i = e[i].nxt) {
    dep[e[i].to] = dep[now] + 1;
    dfs(e[i].to);
    sz[now] += sz[e[i].to];
    if (!son[now] || sz[son[now]] < sz[e[i].to]) son[now] = e[i].to;
  }
}
void dfs2(int now) {
  idfn[dfn[now] = ++idx] = now;
  if (son[now])
    top[son[now]] = top[now], dfs2(son[now]);
  else
    tail[top[now]] = now;
  for (int i = head[now]; i; i = e[i].nxt)
    if (e[i].to != son[now]) dfs2(top[e[i].to] = e[i].to);
  if (top[now] == now) {
    int l = dfn[now], r = dfn[tail[now]], siz = 1.44 * sqrt(r - l + 1);
    for (int i = l; i <= r; i += siz) {
      const int L = i, R = min(i + siz - 1, r);
      G[++blocks].init(L, R);
      for (int j = L; j <= R; ++j) bel[j] = blocks;
      all += G[blocks].ans;
    }
  }
}
void erase(int x) {
  int id = dfn[x];
  if (col[x]) return;
  col[x] = 1;
  G[bel[id]].add(id, 100001);
  for (x = fa[x]; x; x = fa[top[x]]) {
    int L = dfn[top[x]], R = dfn[x];
    const int bL = bel[L], bR = bel[R];
    for (int i = bL; i <= bR; ++i) G[i].dec(L, R);
  }
}
void add(int x) {
  int id = dfn[x];
  if (!col[x]) return;
  col[x] = 0;
  G[bel[id]].add(id, -100001);
  for (x = fa[x]; x; x = fa[top[x]]) {
    int L = dfn[top[x]], R = dfn[x];
    const int bL = bel[L], bR = bel[R];
    for (int i = bL; i <= bR; ++i) G[i].inc(L, R);
  }
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> m;
  for (int i = 2; i <= n; ++i) {
    cin >> fa[i];
    e[++cnt] = (edge){i, head[fa[i]]}, head[fa[i]] = cnt;
  }
  for (int i = 1; i <= n; ++i) cin >> t[i], ++t[i];
  dfs(dep[1] = 1);
  dfs2(top[1] = 1);
  while (m--) {
    int k;
    cin >> k;
    if (k > 0)
      erase(k);
    else
      add(-k);
    cout << all << ' ';
  }
  return 0;
}
