#include <bits/stdc++.h>
using namespace std;
int n, i;
int p[2018], down[2018], bb[2018];
int main() {
  cin >> n;
  for (i = 2; i <= n; i++) {
    cin >> p[i];
    down[p[i]]++;
  }
  for (i = 2; i <= n; i++) {
    if (down[i] == 0) bb[p[i]]++;
  }
  for (i = 1; i <= n; i++) {
    if (down[i] != 0 && bb[i] < 3) {
      cout << "No\n";
      return 0;
    }
  }
  cout << "Yes\n";
  return 0;
}
