#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e3 + 10;
int h[maxn], p[maxn], c[maxn], n;
int main() {
  memset(h, 0, sizeof(h));
  memset(p, 0, sizeof(p));
  memset(c, 0, sizeof(c));
  scanf("%d", &n);
  int num = 0;
  for (int i = 2; i <= n; i++) {
    int x;
    scanf("%d", &x);
    h[x] = ++num;
    p[i] = x;
  }
  for (int i = 2; i <= n; i++)
    if (!h[i]) ++c[p[i]];
  bool flag = 0;
  for (int i = 1; i <= n; i++)
    if (h[i] && c[i] < 3) {
      flag = 1;
      break;
    }
  if (!flag)
    puts("Yes");
  else
    puts("No");
  return 0;
}
