#include <bits/stdc++.h>
using namespace std;
using namespace std;
long long par[1005];
long long deg[1005];
long long cnt[1005];
int main() {
  long long n;
  cin >> n;
  for (long long i = 2; i <= n; i++) {
    long long a;
    cin >> a;
    par[i] = a;
    deg[a]++;
  }
  for (long long i = 1; i <= n; i++) {
    if (!deg[i]) cnt[par[i]]++;
  }
  for (long long i = 1; i <= n; i++) {
    if (deg[i] > 0 && cnt[i] < 3) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}
