#include <bits/stdc++.h>
using namespace std;
queue<long long> q;
map<pair<long long, long long>, long long> m;
pair<long long, long long> p;
long long n, u, v, cnt[1000000], a[1000000], pos;
signed main() {
  scanf("%lld", &n);
  for (long long i = 1; i < n; i++) {
    scanf("%lld %lld", &u, &v);
    cnt[u]++;
    cnt[v]++;
    p.first = u;
    p.second = v;
    m[p] = 1;
    p.first = v;
    p.second = u;
    m[p] = 1;
  }
  for (long long i = 1; i <= n; i++) {
    scanf("%lld", &a[i]);
  }
  if (a[1] != 1)
    printf("No");
  else {
    pos = 1;
    q.push(1);
    while (pos < n) {
      u = q.front();
      q.pop();
      p.first = u;
      for (long long i = 1; i <= cnt[u]; i++) {
        p.second = a[++pos];
        if (m[p] != 1) {
          printf("No");
          return 0;
        } else {
          cnt[a[pos]]--;
          q.push(a[pos]);
        }
      }
    }
    printf("Yes");
  }
}
