#include <bits/stdc++.h>
using namespace std;
template <typename T>
using vc = vector<T>;
using pii = pair<long long, long long>;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long n;
  cin >> n;
  vc<vc<long long> > adi(n);
  long long temp, tamp;
  for (long long i = 0; i + 1 < n; i++) {
    cin >> temp >> tamp;
    temp--;
    tamp--;
    adi[temp].push_back(tamp);
    adi[tamp].push_back(temp);
  }
  vc<long long> ord(n);
  for (long long i = 0; i < n; i++) {
    cin >> ord[i];
    ord[i]--;
  }
  vc<long long> vis(n);
  vis[0] = 2;
  long long geht = 1;
  long long index = 1;
  for (long long i = 0; i < n && geht == 1; i++) {
    long long node = ord[i];
    if (vis[node] != 2) {
      geht = 0;
      break;
    }
    set<long long> krat;
    for (long long j = 0; j < adi[node].size(); j++) {
      long long next = adi[node][j];
      if (vis[next] != 0)
        continue;
      else {
        krat.insert(next);
        vis[next] = 2;
      }
    }
    while (!krat.empty()) {
      if (krat.find(ord[index]) == krat.end()) {
        geht = 0;
        break;
      } else {
        krat.erase(ord[index]);
      }
      index++;
    }
  }
  if (geht == 1) {
    cout << "Yes\n";
  } else
    cout << "No\n";
}
