#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> adj[1005];
int main() {
  cin >> n;
  for (int i = 2; i <= n; i++) {
    int u;
    cin >> u;
    adj[u].push_back(i);
  }
  bool flag = 1;
  for (int i = 1; i <= n; i++) {
    if (adj[i].empty()) continue;
    int leaf = 0;
    for (auto v : adj[i]) leaf += (adj[v].empty());
    flag &= leaf >= 3;
  }
  cout << (flag ? "Yes" : "No") << '\n';
  return 0;
}
