import java.io.*;
import java.util.*;
import java.util.function.Function;

public class Main {

    static int N;
    static int[] U, V;
    static int[] A;

    public static void main(String[] args) {
        FastScanner sc = new FastScanner(System.in);
        N = sc.nextInt();
        U = new int[N-1];
        V = new int[N-1];
        for (int i = 0; i < N - 1; i++) {
            U[i] = sc.nextInt()-1;
            V[i] = sc.nextInt()-1;
        }
        A = sc.nextIntArray(N, -1);

        System.out.println(solve() ? "Yes" : "No");
    }

    static boolean solve() {
        if( A[0] != 0 ) return false;

        int[][] G = adjB(N, U, V);

        Map<Integer, Integer> parents = new HashMap<>();
        for (Node node : orderFromRoot(N, G, 0)) {
            parents.put(node.a, node.parent);
        }
        ArrayDeque<Integer> q = new ArrayDeque<>();
        for (int next : G[0]) {
            q.add(0);
        }

        int idx = 1;
        while(!q.isEmpty()) {
            int p = q.poll();
            int a = A[idx++];
            if( parents.get(a) != p ) {
                return false;
            }

            for (int next : G[a]) {
                if( next == p ) continue;

                q.add(a);
            }
        }
        return true;
    }

    static int[][] adjB(int n, int[] from, int[] to) {
        int[][] adj = new int[n][];
        int[] cnt = new int[n];
        for (int f : from) {
            cnt[f]++;
        }
        for (int t : to) {
            cnt[t]++;
        }
        for (int i = 0; i < n; i++) {
            adj[i] = new int[cnt[i]];
        }
        for (int i = 0; i < from.length; i++) {
            adj[from[i]][--cnt[from[i]]] = to[i];
            adj[to[i]][--cnt[to[i]]] = from[i];
        }
        return adj;
    }

    static Node[] orderFromRoot(int N, int[][] G, int root) {
        ArrayDeque<Node> q = new ArrayDeque<>();
        Node[] ret = new Node[N];
        int idx = 0;
        q.add(new Node(-1, root));
        while(!q.isEmpty()) {
           ... Which one is the correct time complexity of the code snippet: constant, linear, quadratic, cubic, log(n), nlog(n) or NP-hard?