#include <bits/stdc++.h>
using namespace std;
const int maxn = 2000 * 100 + 100;
bool mark[maxn], WasPar[maxn];
int n, dis[maxn], a[maxn], par[maxn], ch[maxn];
vector<int> G[maxn];
void dfs(int u) {
  mark[u] = 1;
  for (int i = 0; i < G[u].size(); i++)
    if (!mark[G[u][i]]) {
      par[G[u][i]] = u;
      ch[u]++;
      dis[G[u][i]] = dis[u] + 1;
      dfs(G[u][i]);
    }
}
int main() {
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    cin >> u >> v;
    u--, v--;
    G[u].push_back(v);
    G[v].push_back(u);
  }
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    a[i]--;
  }
  if (a[0] != 0) {
    cout << "No\n";
    exit(0);
  }
  dfs(0);
  for (int i = 1; i < n; i++)
    if (dis[a[i]] < dis[a[i - 1]]) {
      cout << "No\n";
      return 0;
    }
  queue<int> Q;
  Q.push(0);
  int prvQ = 0, id = 1;
  while (id < n) {
    while (Q.size() and ch[prvQ] == 0) {
      Q.pop();
      prvQ = Q.front();
    }
    if (Q.size() == 0 || par[a[id]] != prvQ) {
      cout << "No\n";
      return 0;
    }
    ch[prvQ]--;
    Q.push(a[id]);
    id++;
  }
  cout << "Yes\n";
  return 0;
}
