#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 7;
vector<int> adj[N];
bool vis[N];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i < n; i++) {
    int u, v;
    cin >> u >> v;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  list<int> v(n);
  for (int& i : v) cin >> i;
  bool flag = true;
  if (v.front() != 1) flag = false;
  queue<int> Q;
  Q.push(v.front()), v.pop_front();
  while (!Q.empty()) {
    int top = Q.front();
    Q.pop(), vis[top] = true;
    set<int> s1, s2;
    list<int> x;
    for (int i : adj[top]) {
      if (vis[i]) continue;
      s1.insert(i);
    }
    for (int i = 0; i < s1.size(); i++) {
      x.push_back(v.front());
      s2.insert(v.front());
      v.pop_front();
    }
    if (s1 != s2) {
      flag = false;
      break;
    }
    while (x.size()) Q.push(x.front()), x.pop_front();
  }
  cout << (flag ? "Yes" : "No") << endl;
}
