#include <bits/stdc++.h>
#pragma GCC optimize("O2")
using namespace std;
const long long MAX = 2e5 + 5;
const int MOD = 1000000000 + 7;
const long long INF = 1e18;
const int nr[] = {0, -1, 0, 1, 1, 1, -1, -1, 2, 2, -2, -2, 1, 1, -1, -1};
const int nc[] = {1, 0, -1, 0, 1, -1, 1, -1, 1, -1, 1, -1, 2, -2, 2, -2};
int n, x[MAX], y, cnt, res, sz, a, b, nw, nx, cur, par, lnw;
pair<int, int> vis[MAX];
vector<int> v[MAX], lvl[MAX];
queue<int> q;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (long long i = 2; i <= n; i++) {
    cin >> a >> b;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  q.push(1);
  vis[1] = {1, 0};
  while (!q.empty()) {
    cur = q.front();
    q.pop();
    for (auto i : v[cur]) {
      if (vis[i].first) continue;
      vis[i] = {vis[cur].first + 1, cur};
      q.push(i);
    }
  }
  nw = 0, lnw = 2;
  for (long long i = 1; i <= n; i++) {
    cin >> a;
    if (vis[a].first < nw || vis[a].first > nw + 1) return cout << "No", 0;
    nw = vis[a].first;
    lvl[nw].push_back(a);
    x[i] = a;
  }
  nw = 0;
  for (long long i = 2; i <= n; i++) {
    par = vis[vis[x[i]].second].first;
    if (lnw != par) nw = 0, lnw = par;
    while (nw < lvl[par].size() && lvl[par][nw] != vis[x[i]].second) nw++;
    if (nw == lvl[par].size()) return cout << "No", 0;
  }
  cout << "Yes";
  return 0;
}
