#include <bits/stdc++.h>
using namespace std;
const int N = 1050;
int n;
bool nonl[N];
int tot[N];
int fa[N];
int getint() {
  char ch = getchar();
  int res = 0;
  while ((ch < '0' || ch > '9') && ch != '-') ch = getchar();
  bool neg = 0;
  if (ch == '-') {
    neg = 1;
    ch = getchar();
  }
  while ('0' <= ch && ch <= '9') {
    res = res * 10 + ch - '0';
    ch = getchar();
  }
  if (neg) res = -res;
  return res;
}
int main() {
  int i, j;
  n = getint();
  for (i = 2; i <= n; i++) {
    fa[i] = getint();
    nonl[fa[i]] = 1;
  }
  for (i = 2; i <= n; i++) {
    if (!nonl[i]) tot[fa[i]]++;
  }
  for (i = 1; i <= n; i++) {
    if (nonl[i] && tot[i] < 3) break;
  }
  if (i <= n)
    printf("No\n");
  else
    printf("Yes\n");
  return 0;
}
