#include <bits/stdc++.h>
using namespace std;
set<int> vec[200001];
int arr[200001];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i < n; i++) {
    int a, b;
    cin >> a >> b;
    vec[a].insert(b);
    vec[b].insert(a);
  }
  for (int i = 1; i <= n; i++) cin >> arr[i];
  queue<int> que;
  que.push(1);
  int ind = 2;
  bool p = 1;
  while (que.size()) {
    int x = que.front();
    que.pop();
    int num = 0;
    while (ind <= n && vec[x].find(arr[ind]) != vec[x].end()) {
      que.push(arr[ind]);
      ind++;
      num++;
    }
    if (x == 1 && num != vec[1].size()) p = 0;
    if (x != 1 && num != vec[x].size() - 1) p = 0;
  }
  if (!p)
    cout << "No" << endl;
  else
    cout << "Yes" << endl;
  return 0;
}
