#include <bits/stdc++.h>
using namespace std;
map<int, int> cuan[200010];
int main() {
  int n;
  int a, b;
  scanf("%d", &n);
  for (int i = 0; i < n - 1; i++) {
    scanf("%d%d", &a, &b);
    cuan[a][b] = 1;
    cuan[b][a] = 1;
  }
  int arr[200010];
  for (int i = 1; i <= n; i++) {
    scanf("%d", &arr[i]);
  }
  int j = 2;
  long long sum = 1;
  for (int i = 1; i <= n; i++) {
    while (cuan[arr[i]][arr[j]]) {
      sum++;
      j++;
    }
  }
  if (sum == n && arr[1] == 1)
    printf("Yes");
  else
    printf("No");
  return 0;
}
