#include <bits/stdc++.h>
using namespace std;
int n, x, y;
vector<int> g[1000000], ans;
int a[1000000], b[1000000];
bool vis[1000000];
bool cmp(int l, int m) { return b[l] < b[m]; }
int main() {
  cin >> n;
  for (int i = 1; i < n; i++) {
    cin >> x >> y;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    b[a[i]] = i;
  }
  for (int i = 1; i <= n; i++) {
    sort(g[i].begin(), g[i].end(), cmp);
  }
  queue<int> q;
  q.push(1);
  while (!q.empty()) {
    x = q.front();
    q.pop();
    ans.push_back(x);
    vis[x] = true;
    for (auto it : g[x]) {
      if (!vis[it]) {
        q.push(it);
      }
    }
  }
  for (int i = 0; i < ans.size(); i++) {
    if (ans[i] != a[i]) {
      cout << "No";
      return 0;
    }
  }
  cout << "Yes";
}
