#include <bits/stdc++.h>
using namespace std;
const int maxn = 200005, INF = 0x7fffffff;
int n;
map<int, bool> w[maxn];
int a[maxn];
bool bfs() {
  queue<int> Q;
  int nex = 0;
  if (a[nex] != 1) return false;
  Q.push(a[nex]);
  nex++;
  while (!Q.empty()) {
    int u = Q.front();
    Q.pop();
    int v = a[nex];
    while (w[u][v]) {
      Q.push(v);
      nex++;
      v = a[nex];
    }
  }
  if (nex == n) return true;
  return false;
}
int main() {
  scanf("%d", &n);
  int u, v;
  for (int i = 0; i < n - 1; i++) {
    scanf("%d", &u), scanf("%d", &v);
    w[u][v] = w[v][u] = 1;
  }
  for (int i = 0; i < n; i++) scanf("%d", &a[i]);
  if (n == 1)
    cout << "Yes" << endl;
  else if (bfs())
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
