#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int n;
vector<int> q, t[N];
map<int, int> mp[N];
void dfs(int v, int last = -1) {
  for (auto to : t[v])
    if (to != last) {
      ++mp[v][to];
      dfs(to, v);
    }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; ++i) {
    int x, y;
    scanf("%d%d", &x, &y);
    t[x].push_back(y);
    t[y].push_back(x);
  }
  dfs(1);
  for (int i = 0; i < n; ++i) {
    int x;
    scanf("%d", &x);
    q.push_back(x);
  }
  int p = 1;
  for (auto it : q) {
    if (p == n) break;
    int sz = mp[it].size();
    for (int i = p; i < p + sz; ++i)
      if (!mp[it][q[i]]) {
        printf("No");
        return 0;
      }
    p += sz;
  }
  printf("Yes");
  return 0;
}
