#include <bits/stdc++.h>
const int maxn = 1e4 + 7;
int p[200010];
using namespace std;
vector<int>::iterator it;
map<int, bool> M[200010];
int vis[200010];
int n;
void bfs() {
  queue<int> Q;
  Q.push(1);
  vis[1] = 0;
  int index = 1;
  index++;
  while (!Q.empty()) {
    int k = Q.front();
    Q.pop();
    while (M[k][p[index]]) {
      Q.push(p[index++]);
    }
  }
  printf(index == n + 1 ? "Yes" : "No");
}
int main() {
  cin >> n;
  for (int i = 1; i <= n - 1; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    M[a][b] = M[b][a] = 1;
  }
  for (int i = 1; i <= n; i++) {
    scanf("%d", &p[i]);
  }
  if (p[1] == 1) {
    bfs();
  } else {
    printf("No\n");
  }
}
