#include <bits/stdc++.h>
using namespace std;
int n;
int que[200005];
int main() {
  cin >> n;
  set<int> a[200005];
  memset(que, 0, sizeof(que));
  for (int i = 1; i < n; i++) {
    int x, y;
    cin >> x >> y;
    a[x].insert(y);
    a[y].insert(x);
  }
  int front = 1;
  int rear = 1;
  que[front] = 1;
  int head;
  int tmp;
  cin >> tmp;
  if (tmp != 1) {
    cout << "No" << endl;
    return 0;
  }
  while (front <= rear) {
    head = que[front++];
    int cnt = a[head].size();
    for (int i = 1; i <= cnt; i++) {
      int x;
      cin >> x;
      if (a[head].count(x)) {
        a[head].erase(x);
        a[x].erase(head);
        que[++rear] = x;
      }
    }
    if (!a[head].empty()) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}
