#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];
void dfs(int v)
{
used[v] = true;
for (int i = 0; i < g[v].size(); i++)
{
int to = g[v][i];
if (!used[to] && !captured[to])
{
dfs(to);
}
}
}
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);
}
for (int j = 0; j < q; j++)
{
int a;
cin >> a;
a--;
if (captured[a])
captured[a] = false;
else
captured[a] = true;
for (int i = 0; i < n; i++)
{
used[i] = false;
}
int comp = 0;
for (int i = 0; i < n; i++)
{
if (!used[i] && !captured[i])
{
dfs(i);
comp += 1;
}
}
cout << comp << endl;
}
}