#include <bits/stdc++.h>
using namespace std;
const long long INFll = 1ll * 1000000100 * 1000000100;
const long double PI =
    3.141592653589793238462643383279502884197169399375105820974944;
vector<vector<int>> g;
vector<int> p, st;
void dfs(int node, int pt = 0) {
  p[node] = pt;
  for (int u : g[node]) {
    if (u != pt) dfs(u, node);
  }
}
int main() {
  int n;
  cin >> n;
  g.resize(n);
  p.resize(n);
  st.assign(n, 1000000100);
  for (int i = 0; i < n - 1; i++) {
    int x, y;
    cin >> x >> y;
    x--;
    y--;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  vector<int> li(n);
  for (int i = 0; i < n; i++) {
    cin >> li[i];
    li[i]--;
  }
  dfs(0);
  if (li[0] != 0) {
    cout << "No" << endl;
    return 0;
  }
  st[0] = 0;
  for (int i = 1; i < n; i++) {
    int v = li[i], u = li[i - 1];
    if (st[p[u]] > st[p[v]]) {
      cout << "No" << endl;
      return 0;
    }
    st[v] = i;
  }
  cout << "Yes" << endl;
}
