#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define drep(i, cc, n) for (ll i = (cc); i <= (n); ++i)
#define rep(i, n) drep(i, 0, n - 1)
#define P pair<ll, ll>
#define all(a) (a).begin(), (a).end()
#define pb push_back
#define fi first
#define se second

int main(){
    ll n;
    cin >> n;

    vector<ll> a(n);
    rep(i, n) cin >> a[i];

    vector<bool> surplus(200, false);
    vector<vector<ll>> sup_info(200);
    ll cnt = min(n, (ll)8);
    ll mod = 200;
    drep(bit, 1, ((1<<cnt)-1)){
        ll tmp = 0;
        ll count = 0;
        rep(i, n) if((bit>>i) & 1){
            count++;
            tmp += a[i];
            tmp%=mod;
        }
        if(surplus[tmp] == false){
            surplus[tmp] = true;
            rep(i, n) if((bit>>i) & 1) sup_info[tmp].pb(i);
        }else{
            cout << "Yes" << endl;
            ll size = sup_info[tmp].size();
            cout << size;
            rep(i, size) cout << " " << sup_info[tmp][i]+1;
            cout << endl;
            cout << count;
            rep(i, n) if((bit>>i) & 1) cout << " " << i+1;
            cout << endl;
            return 0;
        }
    }
    cout << "No" << endl;
}
#include<bits/stdc++.h>
#define inf 999999999
using namespace std;
const int maxn=1e5+10;
int n,sz[maxn],h[maxn],tot,f[maxn];
struct edge{int t,n;}e[maxn<<1];
void ins(int u,int v){e[++tot]=edge{v,h[u]};h[u]=tot;}
void dfs(int v,int fa)
{
	int sum=0;
	vector<int>seq;
	for(int i=h[v];i;i=e[i].n)
	{
		if(e[i].t==fa)continue;
		dfs(e[i].t,v);
		sz[v]+=sz[e[i].t];
		if(sz[e[i].t]%2)
		{
			seq.push_back(-f[e[i].t]);
		}
		else
		{
			if(f[e[i].t]<0)f[v]+=f[e[i].t];
			else sum-=f[e[i].t];
		}
	}
	sort(seq.begin(),seq.end(),greater<int>{});
	seq.push_back(sum);
	for(int i=0;i<(int)seq.size();i++)
	{
		if(i%2) f[v]+=seq[i];
		else f[v]-=seq[i];
	}
};
signed main()
{
	cin>>n;
	for(int i=2,t;i<=n;i++)
	{
		cin>>t;ins(i,t);ins(t,i);
	}
	for(int i=1;i<=n;i++)f[i]=sz[i]=1;
	
	dfs(1,0);
	cout<<(f[1]+n)/2<<endl;
	return 0;
}