#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int n, a[N], t[N], res[N];
vector<int> graph[N];
bool vis[N];
bool bfs(int s) {
  queue<int> Q;
  Q.push(1);
  int id = 0;
  memset(vis, false, sizeof(vis));
  while (!Q.empty()) {
    int f = Q.front();
    Q.pop();
    if (vis[f]) continue;
    vis[f] = true;
    res[++id] = f;
    for (auto x : graph[f]) {
      if (!vis[x]) Q.push(x);
    }
  }
  for (int i = 1; i <= n; i++) {
    if (a[i] != res[i]) return false;
  }
  return true;
}
bool cmp(int a, int b) { return (t[a] < t[b]); }
int main(int argc, char const *argv[]) {
  scanf("%d", &n);
  for (int i = 1; i <= n - 1; i++) {
    int u, v;
    scanf("%d %d", &u, &v);
    graph[u].push_back(v), graph[v].push_back(u);
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]), t[a[i]] = i;
  }
  if (a[1] != 1) return printf("No\n"), 0;
  for (int i = 1; i <= n; i++) {
    sort(graph[i].begin(), graph[i].end(), cmp);
  }
  if (bfs(1))
    printf("Yes\n");
  else
    printf("No\n");
  return 0;
}
