#include <bits/stdc++.h>
using namespace std;
set<int> xxx[1000001], v[1000001], s[1000001];
int visited[1000001];
int main() {
  int n;
  cin >> n;
  for (int i = 1; i < n; i++) {
    int x, y;
    cin >> x >> y;
    xxx[x].insert(y);
    xxx[y].insert(x);
  }
  queue<int> q;
  q.push(1);
  visited[1] = 1;
  while (!q.empty()) {
    int xx = q.front();
    q.pop();
    for (auto j : xxx[xx]) {
      if (!visited[j]) {
        v[xx].insert(j);
        q.push(j);
        visited[j] = 1;
      }
    }
  }
  int arr[n + 1];
  for (int i = 1; i <= n; i++) {
    cin >> arr[i];
  }
  if (arr[1] != 1) {
    return !(cout << "No");
  }
  int pos;
  pos = (v[arr[1]].size()) + 2;
  for (int i = 2; i <= 1 + v[arr[1]].size(); i++) {
    s[1].insert(arr[i]);
  }
  for (int i = 2; i <= n; i++) {
    int l = v[arr[i]].size() - 1;
    int k;
    for (k = pos; k <= pos + l && k <= n; k++) {
      s[arr[i]].insert(arr[k]);
    }
    pos = k;
  }
  for (int i = 1; i <= n; i++) {
    if (s[i] != v[i]) {
      return !(cout << "No");
    }
  }
  cout << "Yes";
}
