#include <bits/stdc++.h>
using namespace std;
long long int n;
long long int a[200005];
vector<long long int> adj[200005];
set<long long int> nei[200005];
queue<long long int> q;
bool vis[200005];
void dfs(long long int i, long long int p) {
  for (auto j : adj[i])
    if (j != p) {
      nei[i].insert(j);
      dfs(j, i);
    }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i < n; i++) {
    long long int x, y;
    cin >> x >> y;
    adj[x].push_back(y), adj[y].push_back(x);
  }
  dfs(1, 1);
  for (int i = 1; i <= n; i++) cin >> a[i];
  if (a[1] != 1) return cout << "No" << '\n', 0;
  q.push(1);
  long long int cur = 2;
  vis[1] = 1;
  while (q.size()) {
    long long int i = q.front();
    q.pop();
    for (int j = 1; j < adj[i].size() + (i == 1); j++) {
      if (nei[i].find(a[cur]) == nei[i].end()) return cout << "No" << '\n', 0;
      vis[a[cur]] = 1;
      q.push(a[cur]);
      cur++;
    }
  }
  cout << "Yes" << '\n';
  return 0;
}
