#include <bits/stdc++.h>
using namespace std;
map<long long, long long> d[200001];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  for (long long i = 1; i < n; i++) {
    long long x, y;
    cin >> x >> y;
    d[x][y] = 1;
    d[y][x] = 1;
  }
  deque<long long> a;
  for (long long i = 0; i < n; i++) {
    long long x;
    cin >> x;
    a.push_back(x);
  }
  queue<long long> q;
  q.push(1);
  if (a.front() != 1) {
    cout << "No\n";
    return 0;
  }
  a.pop_front();
  while (!q.empty()) {
    long long s = q.front();
    q.pop();
    while (!a.empty() and d[s][a.front()]) {
      q.push(a.front());
      a.pop_front();
    }
  }
  if (a.empty()) {
    cout << "Yes";
  } else {
    cout << "No";
  }
}
