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

typedef long long ll;
typedef pair<int, int> pii;
#define FOR(i, n) for(int (i)=0; (i)<(n); (i)++)
#define FOR1(i, n) for(int (i)=1; (i)<=(n); (i)++)
#define FORI(i, n) for(int (i)=n-1; (i)>=0; (i)--)
template<class T, class U> void umin(T& x, const U& y){ x = min(x, (T)y);}
template<class T, class U> void umax(T& x, const U& y){ x = max(x, (T)y);}
template<class T, class U> void init(vector<T> &v, U x, size_t n) { v=vector<T>(n, (T)x); }
template<class T, class U, typename... W> void init(vector<T> &v, U x, size_t n, W... m) { v=vector<T>(n);  for(auto& a : v) init(a, x, m...); }

int n;
vector<ll> d; vector<int> mtl;
vector<vector<int>> edges;
vector<int> par;
vector<bool> marked;

int mintoleaf(int u, int p){
    if (mtl[u]!=-1) return mtl[u];
    int ret = n+1;
    for(int v : edges[u]) if (v !=p){
            umin(ret, 1 + mintoleaf(v, u));
        }
    if (edges[u].size() == 1)
        ret = 0;
    return mtl[u] = ret;
}

void dfs1(int u, int p){
    for(int v : edges[u]) if (v !=p){
            d[v] = d[u]+1;
            par[v] = u;
            dfs1(v, u);
        }
}

int dfs(int u, int p, int e){
    d[u] = e;
    vector<pii> o;
    for(int v : edges[u]) if (v != p){
            o.emplace_back(mintoleaf(v, u), v);
            if (marked[v]) o.back().first = 1e9;
        }
    sort(o.begin(), o.end());
    int start = e+1;
    for(auto it : o){
        int dist = dfs(it.second, u, start);
        start = dist + 1;
    }
    return start;
}

int main(int argc, char** argv) {
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); cout << setprecision(15);
    if (argc == 2 && atoi(argv[1]) == 123456789) freopen("d:\\code\\cpp\\contests\\stdin", "r", stdin);
    cin >> n;
    edges.resize(n+1);
    d.resize(n+1);
    mtl.resize(n+1, -1);
    FOR(i, n-1){
        int u, v;
        cin >> u >> v;
        edges[u].push_back(v);
        edges[v].push_back(u);
    }

    int ondiag = 1;
    d.clear(); d.resize(n + 1);
    par.clear(); par.resize(n+1);
    dfs1(ondiag, -1);
    int dist = -1;
    ondiag = -1;
    FOR1(u, n) {
        if (d[u] > dist) {
            dist = d[u];
            ondiag = u;
        }
    }
    d.clear(); d.resize(n + 1);
    par.clear(); par.resize(n+1);
    dfs1(ondiag, -1);
    marked.clear(); marked.resize(n+1);

    dist = -1;
    int other = -1;
    FOR1(u, n){
        if (d[u] > dist){
            dist = d[u];
            other = u;
        }
    }

    marked[other] = 1;
    while(other!=ondiag){
        other = par[other];
        marked[other] = 1;
    }

    d.clear(); d.resize(n + 1);
    dfs(ondiag, -1, 1);

    FOR1(i, n)
        cout << d[i] << " "; cout << endl;

    if (argc == 2 && atoi(argv[1]) == 123456789) cout << clock()*1.0/CLOCKS_PER_SEC << " sec\n";
    return 0;
}


//                        YATIN KWATRA

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define ll                      long long
#define ar                      array
#define sz(v)                   (int)(v.size())
#define inf                     1e18
#define int                     ll
#define FIO                     ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ld                      long double
#define ull                     unsigned long long
#define endl                    "\n"
#define fo(i,a,b)               for(int i = a; i<=b ; i++)
#define rfo(i,a,b)              for(int i = a; i>=b ; i--)
#define vii                     vector<int>
#define pq                      priority_queue
#define uomii                   unordered_map<int,int,best_hash>
#define all(v)                  v.begin(),v.end()
#define mp                      make_pair
#define pb                      push_back
#define pob                     pop_back
#define ff                      first
#define ss                      second
#define pii                     pair<int,int>
#define mii                     map<int,int>
#define vvii                    vector<vii>
#define mod                     200
#define MIN                     -1e9
#define pi                      3.1415926535897932384626433832795
#define cz(x)                   63 - __builtin_clzll(x)

using namespace std;
using namespace __gnu_pbds;
template<class T> using oset =  tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;


struct best_hash {
	static uint64_t splitmix64(uint64_t x) {

		x += 0x9e3779b97f4a7c15;
		x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
		x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
		return x ^ (x >> 31);
	}

	size_t operator()(uint64_t x) const {
		static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
		return splitmix64(x + FIXED_RANDOM);
	}
};

void INPUT()
{
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}

/*
----------------------------------------------------------------
   -> Check For Overflows
   -> Out of Bounds
   -> Initialisations of global arrays and variables
----------------------------------------------------------------
*/


void solve()
{
	int n;
	cin >> n;
	vii v(n);
	fo(i, 0, n - 1) cin >> v[i], v[i] %= mod;
	uomii dp;
	n = min(n, 20LL);
	for (int mask = 1; mask < (1 << n); mask++) {
		int sum = 0;
		fo(i, 0, n - 1) if (mask & (1 << i)) sum = (sum + v[i]) % mod;
		if (dp.count(sum)) {
			cout << "YES\n";
			cout << __builtin_popcount(mask) << " ";
			fo(i, 0, n - 1) {
				if (mask & (1 << i)) cout << i + 1 << " ";
			}
			cout << endl;
			cout << __builtin_popcount(dp[sum]) << " ";
			fo(i, 0, n - 1) {
				if (dp[sum] & (1 << i)) cout << i + 1 << " ";
			}
			cout << endl;
			return;

		}
		dp[sum] = mask;
	}
	cout << "NO\n";
}

signed main() {

	FIO
	INPUT();

	int t;
	t = 1;
	//cin >> t;
	fo(i, 0, t - 1) {
		solve();
	}
	return 0;
}
