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