#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
const int N = 100000;
vector<int> g[N];
bool used[N];
bool captured[N];
int parent[N];
int son[N];
void dfs(int v, int p)
{
used[v] = true;
parent[v] = p;
if (p == -1)
son[v] = g[v].size();
else
son[v] = g[v].size() - 1;
for (int i = 0; i < g[v].size(); i++)
{
int to = g[v][i];
if (!used[to])
{
dfs(to, v);
}
}
}
int main()
{
int n, q;
cin >> n >> q;
for (int i = 0; i < n - 1; i++)
{
int a, b;
cin >> a >> b;
a--, b--;
g[a].push_back(b);
g[b].push_back(a);
}
dfs(0, -1);
int ans = 1;
for (int j = 0; j < q; j++)
{
int a;
cin >> a;
a--;
if (captured[a])
{
captured[a] = false;
int cnt = son[a];
if (parent[a] != -1)
{
son[parent[a]] += 1;
if (!captured[parent[a]])
cnt++;
}
ans -= cnt;
ans += 1;
}
else
{
captured[a] = true;
int cnt = son[a];
if (parent[a] != -1)
{
son[parent[a]] -= 1;
if (!captured[parent[a]])
cnt++;
}
ans += cnt;
ans -= 1;
}
cout << ans << endl;
}
}