#include <bits/stdc++.h>
using namespace std;
int a[200005];
set<int> s[200005];
queue<int> q;
int vis[200005];
int f = 0;
void bfs() {
  q.push(1);
  vis[1] = 1;
  int k = 1;
  f = 0;
  if (a[1] != 1) {
    f = 1;
    return;
  }
  while (!q.empty()) {
    int b = q.front();
    q.pop();
    set<int>::iterator ite;
    int sum = 0;
    for (ite = s[b].begin(); ite != s[b].end(); ite++) {
      if (vis[*ite] == 1) continue;
      vis[*ite] = 1;
      sum++;
    }
    for (int i = 1; i <= sum; i++) {
      if (s[b].find(a[i + k]) == s[b].end()) {
        f = 1;
        break;
      }
      q.push(a[i + k]);
    }
    k += sum;
    if (f == 1) break;
  }
}
int main() {
  int n;
  scanf("%d", &n);
  int x, y;
  for (int i = 1; i < n; i++) {
    scanf("%d%d", &x, &y);
    s[x].insert(y);
    s[y].insert(x);
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  bfs();
  if (f == 0)
    printf("Yes\n");
  else
    printf("No\n");
}
