#include <bits/stdc++.h>
using namespace std;
const int maxx = 200005;
int id[maxx];
bool vis[maxx];
vector<int> a[maxx];
bool cmp(int x, int y) { return id[x] < id[y]; }
int p[maxx];
int main() {
  int n, l, r;
  scanf("%d", &n);
  memset(vis, 0, sizeof(vis));
  for (int i = 1; i < n; i++) {
    scanf("%d%d", &l, &r);
    a[l].push_back(r);
    a[r].push_back(l);
  }
  for (int i = 0; i < n; i++) {
    scanf("%d", &p[i]);
    id[p[i]] = i;
  }
  for (int i = 1; i <= n; i++) {
    sort(a[i].begin(), a[i].begin() + a[i].size(), cmp);
  }
  queue<int> que;
  while (!que.empty()) {
    que.pop();
  }
  que.push(1);
  vis[1] = 1;
  int idx = 0;
  while (!que.empty()) {
    int tm = que.front();
    que.pop();
    if (tm != p[idx++]) return 0 * printf("No\n");
    if (idx == n) break;
    for (int i = 0; i < a[tm].size(); i++) {
      if (vis[a[tm][i]]) continue;
      vis[a[tm][i]] = 1;
      que.push(a[tm][i]);
    }
  }
  printf("Yes\n");
  return 0;
}
