#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:16777216")
const bool DEBUG = 0;
const int Q = 1 << 22;
struct pp {
  int v, l;
};
vector<int> g[200001];
int used[200001];
char calced[200001];
int arr[200001];
int cnt[200001];
int tr[2 * Q];
int n;
void init(int v) {
  if (v >= Q) {
    if (v - Q < 200001) tr[v] = cnt[v - Q];
  } else {
    init(2 * v);
    init(2 * v + 1);
    tr[v] = tr[2 * v] + tr[2 * v + 1];
  }
}
void bfs() {
  queue<pp> pq;
  pq.push(pp{0, 1});
  used[0] = 1;
  while (!pq.empty()) {
    pp v = pq.front();
    pq.pop();
    cnt[v.l]++;
    for (int i = 0; i < g[v.v].size(); i++) {
      int to = g[v.v][i];
      if (!used[to]) {
        used[to] = v.l + 1;
        pq.push(pp{to, v.l + 1});
      }
    }
  }
}
int get(int l, int r) {
  int res = 0;
  for (l += Q, r += Q; l < r; l /= 2, r /= 2) {
    if (l & 1) res += tr[l++];
    if (r & 1) res += tr[--r];
  }
  return res;
}
void erase(int v) {
  for (v += Q; v; v /= 2) tr[v]--;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin.sync_with_stdio(0);
  cout.tie(0);
  cout.sync_with_stdio(0);
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int s, e;
    cin >> s >> e;
    g[--s].push_back(--e);
    g[e].push_back(s);
  }
  bfs();
  used[n] = 1000000000;
  for (int i = 0; i < n; i++) {
    cin >> arr[i], --arr[i];
  }
  init(1);
  for (int i = 0; i < n; i++) {
    if (calced[arr[i]]) {
      cout << "No";
      return 0;
    }
    calced[arr[i]] = 1;
    int sum = get(0, used[arr[i]]);
    if (sum) {
      cout << "No";
      return 0;
    }
    erase(used[arr[i]]);
  }
  for (int i = 0; i < n; i++) used[i] = 0;
  int j = 0;
  queue<int> pq;
  pq.push(arr[j++]);
  used[0] = 1;
  while (!pq.empty()) {
    int v = pq.front();
    pq.pop();
    set<int> next;
    for (int& to : g[v])
      if (!used[to]) next.insert(to);
    while (!next.empty()) {
      auto it = next.lower_bound(arr[j]);
      if (it == next.end() || *it != arr[j]) {
        cout << "No";
        return 0;
      }
      used[arr[j]]++;
      pq.push(arr[j++]);
      next.erase(it);
    }
  }
  cout << "Yes";
  return 0;
}
