#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
using ll = long long;
using pii = pair<int, int>;

const int mod = 200;

int main(){
    int n;
    cin >> n;
    vector<int> a(n);
    rep(i,n) cin >> a[i];
    rep(i,n) a[i] = a[i] % mod;
    vector<vector<int>> dp(n+1,vector<int>(200));
    vector<vector<int>> pa(200,vector<int>());
    rep(i,n){        
        if(pa[a[i]].size() > 0) {
            cout << "Yes" << endl;
            cout << "1 " << i+1 << endl;
            cout << pa[a[i]].size () << " ";
            rep(pi,pa[a[i]].size()) cout << pa[a[i]].at(pi)+1 << " ";
            cout << endl;
            return 0;
        }
        // dp[i+1][a[i]] = 1;
        pa[a[i]].push_back(i);
        rep(j,200){
            auto output = [&](int fr, int to, int add_choice = -1) {
                if (pa[fr].size() == 0) return false;
                if (fr == a[i]) return false;
                if (pa[fr].size()>0 && pa[fr].back()==i) return false;
                if (pa[to].size() == 0) {
                    if(add_choice != -1) 
                        pa[to] = pa[fr];
                        pa[to].push_back(add_choice);
                    return false;
                }
                cout << "Yes" << endl;
                cout << pa[to].size() << " ";
                rep(pi,pa[to].size()) cout << pa[to].at(pi)+1 << " ";
                cout << endl;

                cout << pa[fr].size() + 1 << " " ;
                rep(pi,pa[fr].size()) cout << pa[fr].at(pi)+1 << " ";
                cout << i+1 << endl;

                return true;
            };
            // if (output(j, j) || output(j, (j + a[i]) % mod, i)) return 0;
            if (output(j, (j + a[i]) % mod, i)) return 0;
            // dp[i+1][j] += dp[i][j];
            // dp[i+1][(j+a[i])%mod] += dp[i][j];
        }        
    }
    cout << "No" << endl;
}
#include <bits/stdc++.h>
using namespace std;

#define REP(i, n) for(int i = 0; i < (n); i++)
#define ALL(a) (a).begin(),(a).end()
#define SORT(a) sort((a).begin(),(a).end())
#define RSORT(a) sort((a).rbegin(),(a).rend())
#define ll long long
#define pb(a) push_back(a)

#define PRINTV(v) {for(ll deB=0; deB<(v).size(); deB++){cout << (v)[deB] << " ";}cout << endl;}

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

	vector<ll> C(N+1);
	vector<ll> A(N);
	vector<ll> B(N);

	REP(i,N) cin >> C[i+1];
	REP(i,N){
		cin >> A[i];
		cin >> B[i];
	}

	vector< vector<ll> > graph(N+1);
	REP(i,N){
		graph[A[i]].push_back(B[i]);
		graph[B[i]].push_back(A[i]);
	}

	vector<ll> ans(N+1,0);
	vector<ll> color(1000000,0);
	vector<ll> arrived(N+1,0);
	stack<ll> root;
	root.push(1);
	while(!root.empty()){
		ll node = root.top();
		//fprintf(stderr, "node:%d(size:%d)(color:%d)\n", node, root.size(), C[node]);
		if(arrived[node] == 0){
			arrived[node] = 1;
			if(color[C[node]] == 0){
				ans[node] = 1;
			}
			color[C[node]]++;
			REP(i, graph[node].size()){
				ll next = graph[node][i];
				if(arrived[next] == 0){
					//fprintf(stderr, "push:%d\n", graph[node][i]);
					root.push(graph[node][i]);
				}
			}
		}else{
			root.pop();
			color[C[node]]--;
		}
	}

	for(int i=1; i<=N; i++){
		if(ans[i] == 1){
			cout << i << endl;
		}
	}

	return 0;

abnormal:
	cout << "No" << endl;
	return 0;
}
