#include <bits/stdc++.h>
using namespace std;
const int N = 200100;
long long read() {
  long long x = 0, f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = x * 10 + c - '0', c = getchar();
  }
  return x * f;
}
struct node {
  int v, nxt;
} e[N << 1];
int head[N], ejs;
void add(int u, int v) {
  e[++ejs].v = v;
  e[ejs].nxt = head[u];
  head[u] = ejs;
}
int fa[N];
void dfs(int u, int father) {
  fa[u] = father;
  for (int i = head[u]; i; i = e[i].nxt) {
    int v = e[i].v;
    if (v == father) continue;
    dfs(v, u);
  }
}
int a[N], pos[N];
int main() {
  int n = read();
  for (int i = 1; i < n; ++i) {
    int u = read(), v = read();
    add(u, v);
    add(v, u);
  }
  dfs(1, 0);
  int p = 0;
  for (int i = 1; i <= n; ++i) {
    a[i] = read();
    pos[a[i]] = i;
  }
  for (int i = 1; i <= n; ++i) {
    int k = fa[a[i]];
    if (pos[k] >= p)
      p = pos[k];
    else {
      puts("No");
      return 0;
    }
  }
  puts("Yes");
  return 0;
}
