#include <bits/stdc++.h>
using namespace std;
int p[10010];
int c[10010];
int s[10010];
int main() {
  int n;
  cin >> n;
  for (int i = 2; i <= n; i++) {
    int x;
    cin >> x;
    p[i] = x;
    c[p[i]]++;
    s[p[i]]++;
  }
  for (int i = 1; i <= n; i++) {
    if (c[i] != 0) s[p[i]]--;
  }
  int flag = 0;
  for (int i = 1; i <= n; i++) {
    if (c[i] != 0 && s[i] < 3) flag = 1;
  }
  if (!flag)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
