#include <bits/stdc++.h>
using namespace std;
const int N = 200010;
vector<int> adj[N];
bool mrk[N];
queue<int> q;
int h[N], a[N], par[N], b[N];
void BFS(int v) {
  mrk[v] = 1;
  q.push(v);
  while (q.size()) {
    int v = q.front();
    q.pop();
    for (int i = 0; i < adj[v].size(); i++) {
      int u = adj[v][i];
      if (!mrk[u]) {
        mrk[u] = 1;
        h[u] = h[v] + 1;
        par[u] = v;
        q.push(u);
      }
    }
  }
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    cin >> u >> v;
    --u;
    --v;
    adj[v].push_back(u);
    adj[u].push_back(v);
  }
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    --a[i];
  }
  par[0] = -1;
  BFS(0);
  for (int i = 1; i < n; i++) {
    if (h[a[i]] < h[a[i - 1]]) {
      cout << "No";
      return 0;
    }
  }
  for (int i = 0; i < n; i++) {
    mrk[i] = 0;
    b[i] = par[a[i]];
  }
  int p = 1;
  q.push(0);
  while (q.size()) {
    int v = q.front();
    q.pop();
    while (par[a[p]] == v) {
      q.push(a[p]);
      p++;
    }
  }
  if (p != n)
    cout << "No";
  else
    cout << "Yes";
}
