#include <bits/stdc++.h>
using namespace std;
void bfs(vector<int> *a, int *parent, bool *visited, int i) {
  visited[i] = true;
  for (auto ii : a[i]) {
    if (visited[ii] == false) {
      parent[ii] = i;
      bfs(a, parent, visited, ii);
    }
  }
}
int main() {
  int n;
  cin >> n;
  vector<int> a[n + 1];
  for (int i = 0; i < n - 1; i++) {
    int x, y;
    cin >> x >> y;
    a[x].push_back(y);
    a[y].push_back(x);
  }
  int b[n + 1];
  b[0] = -1;
  for (int i = 1; i <= n; i++) {
    cin >> b[i];
  }
  int parent[n + 1];
  bool visited[n + 1];
  for (int i = 0; i <= n; i++) visited[i] = false;
  parent[1] = -1;
  bfs(a, parent, visited, 1);
  int ptr = 0;
  for (int i = 1; i <= n; i++) {
    while (ptr <= n && parent[b[i]] != b[ptr]) {
      ptr++;
    }
    if (ptr == n + 1) {
      break;
    }
  }
  if (ptr != n + 1) {
    cout << "Yes\n";
  } else {
    cout << "No\n";
  }
  return 0;
}
