#include <bits/stdc++.h>
using namespace std;
int n, x;
vector<int> ans, G[300000 + 1];
bool visited[300000 + 1];
int IO[300000 + 1], RO[200007];
bool cmp(int a, int b) { return RO[a] < RO[b]; }
int main() {
  cin >> n;
  for (int i = 1; i <= n - 1; i++) {
    int u, v;
    cin >> u >> v;
    G[u].push_back(v);
    G[v].push_back(u);
  }
  for (int i = 1; i <= n; i++) {
    cin >> IO[i];
    RO[IO[i]] = i;
  }
  for (int i = 1; i <= n; i++) sort(G[i].begin(), G[i].end(), cmp);
  queue<int> q;
  q.push(1);
  memset(visited, 0, sizeof(visited));
  while (!q.empty()) {
    int u = q.front();
    q.pop();
    ans.push_back(u);
    visited[u] = 1;
    for (int v : G[u])
      if (!visited[v]) q.push(v);
  }
  for (int i = 1; i <= n; i++)
    if (IO[i] != ans[i - 1]) {
      cout << "No";
      return 0;
    }
  cout << "Yes";
  return 0;
}
