#include <bits/stdc++.h>
using namespace std;
const int inf = (int)1e9;
const int mod = inf + 7;
const double eps = 1e-9;
const double pi = acos(-1.0);
long long read_long() {
  long long ans = 0;
  char c;
  bool started = false;
  bool is_negative = false;
  while (true) {
    c = getchar();
    if ((c < '0' || c > '9') && c != '-' && !started) continue;
    if ((c < '0' || c > '9') && c != '-' && started) break;
    if (started) {
      ans = ans * 10;
    }
    started = true;
    if (c == '-')
      is_negative = true;
    else
      ans += c - '0';
  }
  if (is_negative) ans *= -1;
  return ans;
}
int n;
vector<int> g[200200];
vector<int> gr[200200];
int level[200200];
int a[200200];
int pos[200200];
bool cmp(int a, int b) { return pos[a] < pos[b]; }
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    x--;
    y--;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  for (int i = 0; i < n; i++) {
    scanf("%d", a + i);
    a[i]--;
    pos[a[i]] = i;
  }
  if (a[0] != 0) {
    printf("No\n");
    return 0;
  }
  queue<int> q;
  q.push(0);
  memset(level, -1, sizeof level);
  level[0] = 0;
  int p = 0;
  while ((int)q.size() > 0) {
    int v = q.front();
    q.pop();
    if (v != a[p]) {
      printf("No\n");
      return 0;
    }
    p++;
    gr[level[v]].push_back(v);
    vector<int> tos;
    for (__typeof(g[v].begin()) it = g[v].begin(); it != g[v].end(); it++) {
      int u = *it;
      if (level[u] == -1) {
        tos.push_back(u);
      }
    }
    sort(tos.begin(), tos.end(), cmp);
    for (__typeof(tos.begin()) it = tos.begin(); it != tos.end(); it++) {
      level[*it] = level[v] + 1;
      q.push(*it);
    }
  }
  printf("Yes\n");
  return 0;
}
