#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9 + 10, M = 2e5 + 100, MOD = 1e9 + 7;
long long a[M], p[M], d[M], q[M];
vector<int> adj[M], ad[M];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  for (int i = 1; i < n; i++) {
    long long x, y;
    cin >> x >> y;
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  for (int i = 1; i <= n; i++) {
    d[i] = INF;
    cin >> a[i];
  }
  long long b = 0, e = 0;
  d[1] = 0;
  q[e++] = 1;
  while (b < e) {
    int v = q[b++];
    for (int u : adj[v]) {
      if (d[u] > d[v] + 1) {
        p[u] = v;
        d[u] = d[v] + 1;
        q[e++] = u;
      }
    }
  }
  for (int i = 1; i <= n; i++) {
    ad[p[a[i]]].push_back(a[i]);
    d[i] = INF;
  }
  b = 0, e = 0;
  d[a[1]] = 0;
  q[e++] = a[1];
  while (b < e) {
    int v = q[b++];
    for (int u : ad[v]) {
      if (d[u] > d[v] + 1) {
        d[u] = d[v] + 1;
        q[e++] = u;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    if (a[i + 1] != q[i]) return cout << "No", 0;
  }
  cout << "Yes";
}
