#include <bits/stdc++.h>
using namespace std;
long long n, x, y, v[200005], d[200005], pos[200005], f[200005];
vector<int> grafo[200005];
void dfs(int nodo, int last) {
  f[nodo] = last;
  for (int i = 0; i < grafo[nodo].size(); i++) {
    if (grafo[nodo][i] != last) {
      d[grafo[nodo][i]] = d[nodo] + 1;
      dfs(grafo[nodo][i], nodo);
    }
  }
}
int main() {
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    cin >> x >> y;
    grafo[x].push_back(y);
    grafo[y].push_back(x);
  }
  for (int i = 0; i < n; i++) {
    cin >> v[i];
    pos[v[i]] = i;
  }
  d[1] = 1;
  dfs(1, 0);
  for (int i = 1; i < n; i++) {
    if (d[v[i]] < d[v[i - 1]] || pos[f[v[i]]] < pos[f[v[i - 1]]]) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}
