#include <bits/stdc++.h>
inline int lowbit(int x) { return x & -x; }
const int N = 2e5 + 10;
const int mod = (int)1e9 + 7;
const int INF = 0x3f3f3f3f;
const long long LINF = (1LL << 62);
const double PI = acos(-1.0);
using namespace std;
char buf[100000], *p1 = buf, *p2 = buf;
inline char nc() {
  return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 100000, stdin), p1 == p2)
             ? EOF
             : *p1++;
}
inline bool read(int& x) {
  char c = nc();
  x = 0;
  if (c == EOF) return false;
  bool flag = false;
  for (; !isdigit(c); c = nc()) flag = true;
  for (; isdigit(c); x = x * 10 + c - '0', c = nc())
    ;
  if (flag) x *= -1;
  return true;
}
inline bool readL(long long& x) {
  char c = nc();
  x = 0;
  if (c == EOF) return false;
  bool flag = false;
  for (; !isdigit(c); c = nc()) flag = true;
  for (; isdigit(c); x = x * 10 + c - '0', c = nc())
    ;
  if (flag) x *= -1;
  return true;
}
struct Edge {
  int to, nex;
} edge[N << 1];
int n, sz[N], fa[N], cnt, head[N];
deque<int> Q;
queue<int> que;
bool vis[N];
inline void AddEdge(int u, int v) {
  edge[++cnt].nex = head[u];
  edge[cnt].to = v;
  head[u] = cnt;
  edge[++cnt].nex = head[v];
  edge[cnt].to = u;
  head[v] = cnt;
}
void bfs() {
  que.push(1);
  vis[1] = true;
  while (!que.empty()) {
    int u = que.front();
    que.pop();
    for (int i = head[u]; i; i = edge[i].nex) {
      int v = edge[i].to;
      if (!vis[v]) {
        sz[u]++;
        fa[v] = u;
        vis[v] = true;
        que.push(v);
      }
    }
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    AddEdge(u, v);
  }
  bfs();
  Q.push_back(1);
  for (int i = 1; i <= n; i++) {
    int tmp;
    scanf("%d", &tmp);
    if (i == 1) {
      if (tmp != 1) {
        printf("No\n");
        return 0;
      }
    } else {
      int tag = Q.front();
      if (fa[tmp] == tag) {
        if (sz[tmp]) Q.push_back(tmp);
        sz[tag]--;
        if (sz[tag] == 0) Q.pop_front();
      } else {
        printf("No\n");
        return 0;
      }
    }
  }
  printf("Yes\n");
  return 0;
}
