#include <bits/stdc++.h>
using namespace std;
vector<long long> g[200005];
long long op[200005];
bool cmp(long long a, long long b) { return op[a] < op[b]; }
signed main() {
  long long n;
  cin >> n;
  long long a[n + 1];
  for (long long i = 1; i < n; i++) {
    long long u, v;
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  for (long long i = 1; i <= n; i++) cin >> a[i], op[a[i]] = i;
  for (long long i = 1; i <= n; i++) sort(g[i].begin(), g[i].end(), cmp);
  vector<long long> v;
  queue<long long> q;
  q.push(1);
  long long vis[200005];
  memset(vis, 0, sizeof vis);
  vis[1] = 1;
  while (!q.empty()) {
    long long x = q.front();
    q.pop();
    v.push_back(x);
    for (auto i : g[x]) {
      if (!vis[i]) {
        vis[i] = 1;
        q.push(i);
      }
    }
  }
  long long i = 1;
  for (auto val : v) {
    if (a[i] != val) {
      cout << "No";
      return 0;
    }
    i++;
  }
  cout << "Yes";
}
