#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 100, M = 1e4, LG = 30, base = 2;
const int MOD = 1e9 + 7, mod = 1e9 + 9;
const long long INF = 1e9, inf = 1e18;
long long n, p[N], a[N], b[N];
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  ;
  cin >> n;
  for (int i = 2; i <= n; i++) {
    cin >> p[i];
    a[p[i]]++;
  }
  for (int i = 2; i <= n; i++)
    if (a[i] == 0) b[p[i]]++;
  for (int i = 1; i <= n; i++)
    if (a[i] != 0 && b[i] < 3) return cout << "No", 0;
  return cout << "Yes", 0;
}
