#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
const int MAX = 510000;
long long ar[200010];
bool cmp(long long a, long long b) { return ar[a] < ar[b]; }
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(15);
  long long n, a[200010];
  bool b[200010];
  vector<long long> G[200010], ans;
  queue<long long> que;
  cin >> n;
  for (long long i = 0; i < n - 1; i++) {
    long long a, b;
    cin >> a >> b;
    G[a].push_back(b);
    G[b].push_back(a);
  }
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    ar[a[i]] = i;
  }
  for (long long i = 1; i < n + 1; i++) {
    sort(G[i].begin(), G[i].end(), cmp);
  }
  que.push(1);
  b[1] = 1;
  while (!que.empty()) {
    queue<long long> tmp;
    while (!que.empty()) {
      long long u = que.front();
      que.pop();
      b[u] = 1;
      ans.push_back(u);
      for (long long i = 0; i < (long long)G[u].size(); i++) {
        if (!b[G[u][i]]) {
          tmp.push(G[u][i]);
        }
      }
    }
    que = tmp;
  }
  for (long long i = 0; i < n; i++) {
    if (a[i] != ans[i]) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}
