#include <bits/stdc++.h>
using namespace std;
void Read(int &x, char c = getchar(), bool f = 0) {
  for (x = 0; !isdigit(c); c = getchar())
    if (c == '-') f = 1;
  for (; isdigit(c); c = getchar()) x = 10 * x + c - '0';
  if (f) x = -x;
}
const int maxn = 2005;
int n, m;
int deg[maxn];
int fa[maxn];
bool nf[maxn];
int main() {
  Read(n);
  int i;
  for (i = 2; i <= n; i++) Read(fa[i]), nf[fa[i]] |= 1;
  for (i = 1; i <= n; i++)
    if (!nf[i]) ++deg[fa[i]];
  bool ok = 1;
  for (i = 1; i <= n; i++)
    if (nf[i] && deg[i] < 3) {
      ok = 0;
      break;
    }
  if (ok)
    puts("Yes");
  else
    puts("No");
  return 0;
}
