#include <bits/stdc++.h>
using namespace std;
const int oo = 1e9 + 9;
const long long inf = 1e18 + 18;
const int max6 = 1e6 + 6;
const int modx = 1e9 + 123;
const int mody = 997;
const int base = 137;
int cl[max6], depth[max6], pd[max6];
vector<int> g[max6], tmp[max6];
void dfs(int u) {
  cl[u] = 1;
  for (auto& v : g[u])
    if (cl[v] == 0) {
      pd[v] = u;
      depth[v] = depth[u] + 1;
      dfs(v);
    }
}
int main() {
  int n;
  cin >> n;
  for (int i = 1; i < n; ++i) {
    int u, v;
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  dfs(1);
  int last = 0;
  int pre = 0;
  for (int i = 1; i <= n; ++i) {
    int first;
    cin >> first;
    if (depth[first] < pre) {
      cout << "No";
      return 0;
    }
    pre = depth[first];
    tmp[depth[first]].push_back(first);
    last = max(last, depth[first]);
  }
  for (int i = 1; i <= last; ++i) {
    int j = 0;
    int k = 0;
    int psiz = tmp[i - 1].size() - 1;
    int siz = tmp[i].size() - 1;
    while (k <= siz) {
      while (j <= psiz && pd[tmp[i][k]] != tmp[i - 1][j]) j++;
      if (j > psiz) {
        cout << "No\n";
        return 0;
      }
      k++;
    }
  }
  cout << "Yes\n";
}
