#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <functional>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <bitset>
#include <math.h>
#include <random>
#include <chrono>
#include <assert.h>
using namespace std ;
using ll = long long ;
using ld = long double ;
template<class T> using V = vector<T> ;
template<class T> using VV = V<V<T>> ;
using pll = pair<ll,ll> ;
#define all(v) v.begin(),v.end()
ll mod = 1000000007 ;
long double pie = acos(-1) ;
ll INF = 1e18 ;

void yorn(bool a){if(a) cout << "Yes" << endl ; else cout << "No" << endl ;}
//void YorN(bool a){if(a) cout << "YES" << endl ; else cout << "NO" << endl ;}
ll gcd(long long a,long long b){if(b==0) return a ; return gcd(b,a%b) ;}
ll lcm(long long a,long long b){return a/gcd(a,b)*b ;}
ll extGCD(ll a,ll b,ll &x,ll &y){
    if(b==0){
        x = 1 ;
        y = 0 ;
        return a ;
    }
    ll d = extGCD(b,a%b,y,x) ;
    y -= a/b*x ;
    return d ;
}
void fix_cout(){cout << fixed << setprecision(20) ;}
template<class T> void chmax(T &a,T b){if(a<b) a = b ;}
template<class T> void chmin(T &a,T b){if(a>b) a = b ;}

int main(){
    int n ; cin >> n ;
    VV<int> rem(200) ;
    for(int i=0;i<n;i++){
        ll a ; cin >> a ;
        a %= 200 ;
        for(int j=0;j<200;j++){
            if(rem[(j+a)%200].size()>0){
                if(j!=0&&rem[j].size()==0) continue ;
                cout << "Yes" << endl ;
                cout << rem[(j+a)%200].size() << " " ;
                for(int k=0;k<rem[(j+a)%200].size();k++){
                    cout << rem[(j+a)%200][k] << " \n"[k+1==rem[(j+a)%200].size()] ;
                }
                cout << rem[j].size()+1 << " " ;
                for(auto k:rem[j]) cout << k << " " ; cout << i+1 << endl ;
                return 0 ;
            }
        }
        auto sub = rem ;
        for(int j=0;j<200;j++){
            if(rem[(j+a)%200].size()>0) continue ;
            if(j!=0&&rem[j].size()==0) continue ;
            sub[(j+a)%200] = rem[j] ;
            sub[(j+a)%200].push_back(i+1) ;
        }
        rem = sub ;
        // if(rem[a].size()==0) rem[a].push_back(i+1) ;
        // for(auto j:rem[165]) cout << j << " " ; cout << endl ;
    }
    cout << "No" << endl ;
}
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using str = string;
#define endl "\n"
#define sz(x) (int)(x).size()
#define all(x) begin(x), end(x)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define lb lower_bound 
#define ub upper_bound 
 
constexpr int setbits(int x) { return __builtin_popcount(x); } 
constexpr int bits(int x) { return 32-__builtin_clz(x); } 
str binary(int x) { return bitset<32>(x).to_string(); } 
int decimal(str x) { return stoi(x,nullptr,2); } 
ll cdiv(ll a, ll b) { return a/b+((a^b)>0&&a%b); } 
ll fdiv(ll a, ll b) { return a/b-((a^b)<0&&a%b); } 

const int nax = INT_MAX;
const int nim = INT_MIN;
const int MOD = 1000000007;

void solve(){
	int n; cin >> n;
	vector < ll > a(n);
	for(ll &it : a)
		cin >> it;
	sort(all(a));
	ll sum = 0, ans = 0;
	for(int i = 0; i < n; ++i){
		ans += a[i] * i - sum;
		sum += a[i];
	}
	cout << ans << endl;
}

int main(){
	ios_base::sync_with_stdio(false), cin.tie(nullptr);
	int t = 1;
	// cin >> t;
	while(t--)
		solve();
}