#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
bitset<N> vis;
queue<int> q;
vector<int> g[N];
int arr[N];
int pr[N];
void bfs(int node) {
  vis[node] = 1;
  q.emplace(node);
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    for (int &to : g[u]) {
      if (!vis[to]) {
        pr[to] = u;
        q.emplace(to);
        vis[to] = 1;
      }
    }
  }
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i < n; ++i) {
    int x, y;
    scanf("%d %d", &x, &y);
    g[x].emplace_back(y);
    g[y].emplace_back(x);
  }
  for (int i = 0; i < n; ++i) {
    scanf("%d", arr + i);
  }
  if (arr[0] != 1) {
    puts("No");
    return 0;
  }
  bfs(1);
  q.emplace(1);
  int i = 1;
  while (!q.empty() && i < n) {
    int x = q.front();
    q.pop();
    while (i < n && pr[arr[i]] == x) {
      q.emplace(arr[i++]);
    }
  }
  if (q.empty() && i < n) {
    puts("No");
  } else {
    puts("Yes");
  }
  return 0;
}
