#include <bits/stdc++.h>
std::vector<int> G[200006];
int check, a, i, x, y, D, o[200006], z[200006], par[200006], d[200006];
void dfs(int p) {
  d[p] = D;
  for (int k = 0; k < G[p].size(); k++) {
    if (d[G[p][k]] == 0) {
      D++;
      dfs(G[p][k]);
      D--;
    } else
      par[p] = G[p][k];
  }
}
int main() {
  scanf("%d", &a);
  for (i = 1; i < a; i++) {
    scanf("%d%d", &x, &y);
    G[x].push_back(y);
    G[y].push_back(x);
  }
  D = 1;
  dfs(1);
  for (i = 1; i <= a; i++) {
    scanf("%d", &z[i]);
    o[z[i]] = i;
  }
  for (i = 1; i < a; i++) {
    if (d[z[i]] > d[z[i + 1]])
      check = 1;
    else if (d[z[i]] == d[z[i + 1]]) {
      if (o[par[z[i]]] > o[par[z[i + 1]]]) check = 1;
    }
  }
  if (check == 1)
    puts("No");
  else
    puts("Yes");
}
