#include <bits/stdc++.h>
using namespace std;
set<int> _set[200010];
int q[200010];
int main() {
  int n, x, y;
  scanf("%d", &n);
  for (int i = 1; i < n; ++i) {
    scanf("%d%d", &x, &y);
    _set[x].insert(y);
    _set[y].insert(x);
  }
  for (int i = 1; i <= n; ++i) cin >> q[i];
  if (q[1] != 1) return puts("No"), 0;
  int i = 1, now = 2;
  bool flag = 1;
  while (now <= n && i < now) {
    while (i < now) {
      if (_set[q[i]].find(q[now]) != _set[q[i]].end())
        break;
      else
        i++;
    }
    if (i == now) {
      return puts("No"), 0;
    }
    now++;
  }
  puts("Yes");
  return 0;
}
