#include <bits/stdc++.h>
using namespace std;
int static_init = []() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout << fixed;
  return 0;
}();
constexpr int N = 2e5;
int32_t n, a[N], b[N + 1], p[N + 1];
pair<int32_t, int32_t> e[2 * N];
bool v[N + 1];
bool valid() {
  int i = 0;
  queue<int32_t> q;
  vector<int32_t> ts;
  q.push(1);
  v[1] = true;
  while (!q.empty()) {
    int s = q.front();
    q.pop();
    if (s != a[i++]) return false;
    ts.clear();
    for (int j = b[s]; j < 2 * (n - 1) && e[j].first == s; j++) {
      int t = e[j].second;
      if (!v[t]) v[t] = true, ts.push_back(t);
    }
    sort(ts.begin(), ts.end(), [](int i, int j) { return p[i] < p[j]; });
    for (int t : ts) q.push(t);
  }
  return true;
}
int main() {
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int x, y;
    cin >> x >> y;
    e[2 * i] = {x, y};
    e[2 * i + 1] = {y, x};
  }
  for (int i = 0; i < n; i++) cin >> a[i], p[a[i]] = i;
  sort(e, e + 2 * (n - 1));
  for (int i = 0, j = 1; j <= n; j++) {
    while (i < 2 * (n - 1) && e[i].first < j) i++;
    b[j] = i;
  }
  cout << (valid() ? "Yes" : "No") << endl;
  return 0;
}
