import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop, std.bitmanip;

void main() {
    auto N = readln.chomp.to!int;
    auto G = new int[][](N);
    foreach (_; 0..N-1) {
        auto s = readln.split.map!(to!int);
        G[s[0]-1] ~= s[1]-1;
        G[s[1]-1] ~= s[0]-1;
    }
    auto A = readln.split.map!(x => x.to!int-1).array;

    auto D = new int[](N);
    auto E = new int[][](N);
    auto P = new int[](N);
    auto order = new int[](N);

    void dfs(int n, int p, int d) {
        P[n] = p;
        D[n] = d;
        E[d] ~= n;
        foreach (m; G[n]) if (m != p) dfs(m, n, d+1);
    }
    dfs(0, -1, 0);

    foreach (i; 0..N-1) {
        if (D[A[i]] > D[A[i+1]]) {
            writeln("No");
            return;
        }
    }

    foreach (i; 1..N) {
        if (D[A[i]] > D[A[i-1]]) {
            order[A[i]] = 0;
        } else {
            order[A[i]] = order[A[i-1]] + 1;
        }
    }

    foreach (i; 0..N-1) {
        if (D[A[i]] == D[A[i+1]] && order[P[A[i]]] > order[P[A[i+1]]]) {
            writeln("No");
            return;
        }
    }

    writeln("Yes");
}
