#include <bits/stdc++.h>
using namespace std;
void IO() {
  srand(chrono::steady_clock::now().time_since_epoch().count());
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
int n;
vector<set<int> > g;
vector<set<pair<int, int> > > gg;
vector<int> visited;
vector<int> arr;
vector<int> pos;
int main() {
  IO();
  cin >> n;
  g.resize(n);
  visited.resize(n, 0);
  arr.resize(n);
  int u, v;
  for (__typeof(n - 1) i = (0) - ((0) > (n - 1));
       i != (n - 1) - ((0) > (n - 1)); i += 1 - 2 * ((0) > (n - 1))) {
    cin >> u >> v;
    u--;
    v--;
    g[u].insert(v);
    g[v].insert(u);
  }
  pos.resize(n);
  for (__typeof(n) i = (0) - ((0) > (n)); i != (n) - ((0) > (n));
       i += 1 - 2 * ((0) > (n))) {
    cin >> arr[i];
    arr[i]--;
    pos[arr[i]] = i;
  }
  gg.resize(n);
  for (__typeof(n) i = (0) - ((0) > (n)); i != (n) - ((0) > (n));
       i += 1 - 2 * ((0) > (n))) {
    for (auto it : g[i]) {
      gg[i].insert({pos[it], it});
    }
  }
  if (arr[0] != 0) {
    cout << "No"
         << "\n";
    return 0;
  }
  int ok = 1;
  queue<int> q;
  q.push(0);
  visited[0] = 1;
  vector<long long int> res;
  while (!q.empty()) {
    int u = q.front();
    res.push_back(u);
    q.pop();
    for (auto it : gg[u]) {
      if (!visited[it.second]) {
        visited[it.second] = 1;
        q.push(it.second);
      }
    }
  }
  for (__typeof(n) i = (0) - ((0) > (n)); i != (n) - ((0) > (n));
       i += 1 - 2 * ((0) > (n))) {
    if (arr[i] != res[i]) ok = 0;
  }
  if (ok)
    cout << "Yes"
         << "\n";
  else
    cout << "No"
         << "\n";
  return 0;
}
