#include <bits/stdc++.h>
using namespace std;
const int N = 2e5;
vector<int> adj[N + 1];
vector<int> dist(N + 1, 0);
vector<int> par(N + 1, 0);
void dfs(int s, int p = 0) {
  par[s] = p;
  dist[s] = dist[p] + 1;
  for (int x : adj[s]) {
    if (s == x || dist[x] != 0) continue;
    dfs(x, s);
  }
}
int main() {
  int n;
  cin >> n;
  int nn = n - 1;
  while (nn--) {
    int x, y;
    cin >> x >> y;
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  dfs(1);
  int a[n];
  int f = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (i == 0) {
      if (a[i] != 1) f = 1;
    } else {
      if (dist[a[i]] < dist[a[i - 1]]) f = 1;
    }
  }
  if (f == 1) {
    cout << "No";
    return 0;
  }
  map<int, int> m;
  int mx = -1;
  for (int i = 1; i <= n; i++) {
    m[dist[i]]++;
    mx = max(mx, dist[i]);
  }
  int ptr = 0;
  for (int i = 1; i < n; i++) {
    if (dist[a[i]] == mx) break;
    if (dist[a[i]] != dist[a[i - 1]]) ptr = i + m[dist[a[i]]];
    for (int j = 1; j <= adj[a[i]].size() - 1; j++, ptr++) {
      if (par[a[ptr]] != a[i]) {
        f = 1;
        break;
      }
    }
    if (f == 1) break;
  }
  if (f == 1)
    cout << "No";
  else
    cout << "Yes";
  return 0;
}
