#include <bits/stdc++.h>
using namespace std;
vector<long long int> adj[200010];
long long int vis[200010];
queue<long long int> q;
int main() {
  long long int n;
  cin >> n;
  long long int a, b;
  for (int i = 1; i <= (n - 1); i++) {
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  long long int seq[n];
  for (int i = 0; i < n; i++) cin >> seq[i];
  for (long long int k = 0; k < 200010; k++) {
    vis[200010] = 0;
  }
  if (seq[0] != 1) {
    cout << "No";
    return 0;
  }
  set<long long int> s1, s2;
  long long int m = 1;
  for (int i = 0; i < n; i++) {
    long long int a = seq[i], num = 0;
    vis[a] = 1;
    for (int j = 0; j < adj[a].size(); j++) {
      if (vis[adj[a][j]] == 0) {
        s1.insert(adj[a][j]);
        num++;
      }
    }
    for (int j = m; j < m + num; j++) s2.insert(seq[j]);
    if (s1 == s2) {
      s1.clear();
      s2.clear();
      m += num;
    } else if (s1 != s2) {
      cout << "No";
      return 0;
    }
  }
  cout << "Yes";
}
