#include <bits/stdc++.h>
using namespace std;
const int len = (int)2 * 1e5 + 5;
int ar[len];
bool cmp(int a, int b) { return ar[a] < ar[b]; }
int main() {
  int n;
  cin >> n;
  vector<vector<int>> a(n + 1);
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    cin >> u >> v;
    a[u].emplace_back(v);
    a[v].emplace_back(u);
  }
  vector<int> bfs(n + 1);
  for (int i = 1; i <= n; i++) {
    cin >> bfs[i];
    ar[bfs[i]] = i;
  }
  for (int i = 1; i <= n; i++) {
    sort(a[i].begin(), a[i].end(), cmp);
  }
  vector<int> ans;
  ans.emplace_back(0);
  queue<int> q;
  q.push(1);
  vector<bool> vis(n + 1, 0);
  while (q.size()) {
    int fn = q.front();
    if (vis[fn] == 0) {
      vis[fn] = 1;
      ans.emplace_back(fn);
      for (int i = 0; i < (int)a[fn].size(); i++) {
        if (vis[a[fn][i]] == 0) {
          q.push(a[fn][i]);
        }
      }
    }
    q.pop();
  }
  int flag = 1;
  for (int i = 1; i <= n; i++) {
    if (ans[i] != bfs[i]) {
      flag = 0;
      break;
    }
  }
  if (flag) {
    cout << "Yes";
  } else {
    cout << "No";
  }
  return 0;
}
