#include <bits/stdc++.h>
using namespace std;
int n, a[1111], cnt[1111] = {0};
vector<int> v[1111];
int main() {
  cin >> n;
  for (int i = 2; i <= n; i++) {
    cin >> a[i];
    cnt[a[i]]++;
    v[a[i]].push_back(i);
  }
  for (int i = 1; i <= n; i++)
    if (cnt[i]) {
      int c = 0;
      for (int j = 0; j < v[i].size(); j++) {
        if (!cnt[v[i][j]]) c++;
      }
      if (c < 3) {
        cout << "No";
        return 0;
      }
    }
  cout << "Yes";
  return 0;
}
