#include <bits/stdc++.h>
using namespace std;
const int MAX = 200200;
vector<int> E[MAX];
int main(void) {
  ios_base::sync_with_stdio(false);
  int N;
  cin >> N;
  for (int i = (0); i < (N - 1); ++i) {
    int A, B;
    cin >> A >> B;
    --A, --B;
    E[A].push_back(B);
    E[B].push_back(A);
  }
  vector<int> order(N);
  vector<int> pos(N);
  for (int i = (0); i < (N); ++i) {
    cin >> order[i];
    --order[i];
    pos[order[i]] = i;
  }
  for (int i = (0); i < (N); ++i) {
    sort(E[i].begin(), E[i].end(),
         [&](const int x, const int y) { return pos[x] < pos[y]; });
  }
  vector<int> real_order;
  queue<int> Q;
  Q.push(0);
  vector<bool> visited(N, false);
  visited[0] = true;
  while (!Q.empty()) {
    int x = Q.front();
    Q.pop();
    real_order.push_back(x);
    for (int y : E[x]) {
      if (!visited[y]) {
        Q.push(y);
        visited[y] = true;
      }
    }
  }
  if (real_order == order) {
    cout << "Yes\n";
  } else {
    cout << "No\n";
  }
  return 0;
}
