#include <bits/stdc++.h>
using namespace std;
long long t = 1;
void solve() {
  long long n, x, y, cnt = 0, p = 1;
  cin >> n;
  vector<long long> arr(n + 1), vis(n + 1, 0);
  vector<vector<long long> > v(n + 1);
  for (long long i = 0; i < n - 1; i += 1) {
    cin >> x >> y;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  queue<long long> q1, q;
  for (long long i = 0; i < n; i += 1) {
    cin >> x;
    arr[i] = x;
    q1.push(x);
  }
  q.push(1);
  q1.pop();
  while (!q.empty()) {
    x = q.front();
    vector<long long> vv;
    set<long long> s;
    cnt = 0;
    for (long long i = 0; i < int((v[x]).size()); i += 1) {
      if (vis[v[x][i]] == 0) {
        cnt++;
        vv.push_back(v[x][i]);
      }
    }
    vis[q.front()] = 1;
    q.pop();
    for (long long i = p; i < p + cnt; i += 1) {
      s.insert(arr[i]);
      q.push(arr[i]);
      vis[arr[i]] = 1;
    }
    for (long long i = 0; i < int((vv).size()); i += 1) {
      if (((s).find(vv[i]) != (s).end())) {
        s.erase(vv[i]);
      } else {
        cout << "No";
        return;
      }
    }
    p = p + cnt;
  }
  cout << "Yes";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  while (t--) solve();
  return 0;
}
