#include <bits/stdc++.h>
using namespace std;
class Graph {
  int V;
  list<int> *adjList;
  int a[1000];

 public:
  Graph(int v) {
    V = v;
    for (int i = 1; i <= v; i++) a[i] = 1;
    adjList = new list<int>[V];
  }
  void addEdge(int u, int w) {
    adjList[u].push_back(w);
    a[u] = 0;
  }
  bool check() {
    bool possible = true;
    for (int i = 1; i <= V; i++) {
      long int sum = 0;
      if (a[i] == 0) {
        for (int node : adjList[i]) {
          sum += a[node];
        }
        if (sum < 3) {
          possible = false;
          return false;
        }
      }
    }
    if (possible) {
      return true;
    }
  }
};
int main() {
  int n, t;
  cin >> n;
  Graph g(n);
  for (int i = 2; i <= n; i++) {
    cin >> t;
    g.addEdge(t, i);
  }
  if (g.check()) {
    cout << "Yes";
  } else
    cout << "No";
  return 0;
}
