#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000;
int p[MAXN + 10], cnt[MAXN + 10], hasc[MAXN + 10];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 2; i <= n; i++) scanf("%d", &p[i]);
  for (int i = n; i >= 1; i--) {
    hasc[p[i]] = 1;
    cnt[p[i]] += int(hasc[i] == 0);
  }
  for (int i = 1; i <= n; i++) {
    if (hasc[i] && cnt[i] < 3) {
      printf("No\n");
      return 0;
    }
  }
  printf("Yes\n");
  return 0;
}
