#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<vector<int> > G(n + 1);
  for (int i = 1; i < n; i++) {
    int x, y;
    cin >> x >> y;
    G[x].push_back(y);
    G[y].push_back(x);
  }
  vector<int> O(n);
  for (int i = 0; i < n; i++) cin >> O[i];
  vector<int> L(n + 1, 0);
  queue<int> Q;
  Q.push(1);
  L[1] = 1;
  while (not Q.empty()) {
    int u = Q.front();
    Q.pop();
    int l = L[u];
    for (int v : G[u])
      if (not L[v]) {
        Q.push(v);
        L[v] = l + 1;
      }
  }
  int tick = 1;
  vector<int> P(n + 1, 0);
  P[1] = tick;
  for (int i = 0; i < n - 1; i++) {
    if ((L[O[i]] > L[O[i + 1]]) or
        (L[O[i]] == L[O[i + 1]] and P[O[i]] > P[O[i + 1]])) {
      cout << "No" << endl;
      return 0;
    }
    for (int v : G[O[i]]) P[v] = tick;
    tick++;
  }
  cout << "Yes" << endl;
  return (0 - 0);
}
