#include <bits/stdc++.h>
using namespace std;
long long n, p[200020], ord[200020];
vector<long long> G[200020];
queue<long long> q;
void dfs(long long v, long long par) {
  p[v] = par;
  for (long long w : G[v])
    if (w != par) dfs(w, v);
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    long long a, b;
    cin >> a >> b;
    G[a].push_back(b);
    G[b].push_back(a);
  }
  for (int i = 0; i < n; i++) cin >> ord[i];
  dfs(1, 0);
  for (int i = n - 1; i >= 0; i--) {
    while (!q.empty() and q.front() == ord[i]) q.pop();
    q.push(p[ord[i]]);
  }
  if (q.size() == 1 and q.front() == 0)
    cout << "Yes";
  else
    cout << "No";
  return 0;
}
