#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
void sieveOfEratosthenes(int n, bool prime[]) {
  int i, p;
  for (i = 2; i <= n / 2; i++) {
    if (prime[i]) {
      for (p = i * i; p <= n; p += i) prime[p] = false;
    }
  }
}
unsigned long long int power(unsigned long long int n,
                             unsigned long long int p) {
  unsigned long long int m = 1;
  while (p > 0) {
    m *= n;
    p--;
  }
  return m;
}
bool checkSpruce(int n, std::vector<int> adj[]) {
  int count = 0;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < adj[i].size(); ++j) {
      if (adj[adj[i][j]].size() == 0) count++;
    }
    if (count < 3 && adj[i].size() > 0) return false;
    count = 0;
  }
  return true;
}
int main() {
  int t, n, i, k, m, len, u, v;
  cin >> n;
  vector<int> adj[n];
  for (i = 0; i < n - 1; ++i) {
    cin >> u;
    adj[u - 1].push_back(i + 1);
  }
  if (checkSpruce(n, adj))
    cout << "Yes";
  else
    cout << "No";
  cout << endl;
  return 0;
}
