#include <bits/stdc++.h>
using namespace std;
long long vis[1005];
bool sortcol(const vector<long long>& v1, const vector<long long>& v2) {
  return v1[1] > v2[1];
}
vector<long long> adj[1002];
long long dfs(long long node) {
  if (adj[node].size() == 0) {
    return 1;
  }
  vis[node] = 1;
  long long cnt = 0;
  for (long long child : adj[node]) {
    if (vis[child] == 0) {
      if (adj[child].size() == 0) {
        cnt++;
      }
    }
  }
  if (cnt < 3) {
    return 0;
  }
  for (long long child : adj[node]) {
    if (vis[child] == 0) {
      if (dfs(child) == 0) return 0;
    }
  }
  return 1;
}
long long solve() {
  long long n;
  cin >> n;
  for (long long i = 1; i < n; i++) {
    long long l;
    cin >> l;
    adj[l].push_back(i + 1);
  }
  long long i = dfs(1);
  if (i)
    cout << "Yes";
  else {
    cout << "No";
  }
  return 0;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t;
  solve();
  return 0;
}
