#include <bits/stdc++.h>
using namespace std;
int n, p, w[200005];
int es, fi[200005], e[200005 * 2], nx[200005 * 2];
bool vis[200005], inq[200005];
void addE(int u, int v) {
  e[++es] = v;
  nx[es] = fi[u];
  fi[u] = es;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; ++i) {
    int a, b;
    scanf("%d%d", &a, &b);
    addE(a, b);
    addE(b, a);
  }
  for (int i = 1; i <= n; ++i) scanf("%d", &w[i]);
  if (w[1] != 1) {
    cout << "No" << endl;
    return 0;
  }
  queue<int> q;
  q.push(w[1]);
  vis[w[1]] = true;
  int p = 1;
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    int cnt = 0;
    for (int i = fi[u]; i; i = nx[i]) {
      int v = e[i];
      if (vis[v]) continue;
      cnt++;
      inq[v] = true;
    }
    for (int i = p + 1; i <= p + cnt; ++i) {
      if (!inq[w[i]]) {
        printf("No\n");
        return 0;
      }
      q.push(w[i]);
      vis[w[i]] = true;
    }
    p += cnt;
    for (int i = fi[u]; i; i = nx[i]) {
      int v = e[i];
      if (vis[v]) continue;
      inq[v] = false;
    }
  }
  printf("Yes\n");
  return 0;
}
