#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;  
typedef pair<ll, ll> pd;

void solve(){
    int n;
    cin>>n;
    ull a[n];
    for(int i=0;i<n;i++)cin>>a[i];

    ull pre[n];
    ull mx[n];
    ull sum = a[0];
    ull mxn = a[0];
    pre[0] = a[0];
    mx[0] = a[0];
    for(int i=1;i<n;i++){
        sum += a[i];
        mxn = max(mxn, a[i]);
        pre[i] = sum;
        mx[i] = mxn;
    }

    ull ans[n];
   
    ans[0] = pre[0] + mx[0];
    sum = ans[0];
    for(int i=1;i<n;i++){
        sum -= (i)*(mx[i-1]);
        ull maxcur = mx[i];
        sum += pre[i-1];
        sum += maxcur*(i+1);
        sum += a[i];
        ans[i] = sum;
    }

    for(int i=0;i<n;i++)cout<<ans[i]<<"\n";

}

int32_t main(){
    
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif

    ios_base::sync_with_stdio(false);
    //cin.tie(NULL);
    int t;
    //cin>>t;
    t = 1;
    //cout<<"t: "<<t<<"\n";
    while(t--){
        solve();
    }
    return 0;
}
#include<bits/stdc++.h>
using namespace std;
 
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int               long long
#define endl              "\n"
#define pb                push_back
#define ppb               pop_back
#define pf                push_front
#define ppf               pop_front
#define all(x)            (x).begin(),(x).end()
#define uniq(v)           (v).erase(unique(all(v)),(v).end())
#define sz(x)             (int)((x).size())
#define fr                first
#define sc                second
#define pii               pair<int,int>
#define vi                vector<int>
#define vpi               vector<pair<int,int>>
#define mii               map<int,int>
#define rep(i,a,b)        for(int i=a;i<b;i++)
#define repe(i,a,b)        for(int i=a;i<=b;i++)
#define mem1(a)           memset(a,-1,sizeof(a))
#define mem0(a)           memset(a,0,sizeof(a))
#define ppc               __builtin_popcount
#define ppcll             __builtin_popcountll
#define INF 100000000000000000
#define mod 1000000007
#define esp 10e-7
const int mx=200+7;
int a[mx];
map<int,set<string>>mp;

void solve()
{
  int n;
  cin>>n;
  for(int i=0;i<n;i++)
    cin>>a[i];
  
  int cnt=min(n,9LL);
  for(int i=1;i<(1<<cnt);i++)
  {
    int sum=0;
    string s="";
    for(int j=0;j<cnt;j++)
    {
      if((1<<j)&i)
      {
        sum+=a[j];
        s.pb('0'+j);
      }
    }
    sum=sum%200;
    mp[sum].insert(s);
  }
  for(auto it:mp)
  {
    if(it.sc.size()>1)
    {
      string s=*(it.sc).begin();
      string k=*(it.sc).rbegin();
      cout<<"Yes"<<endl;
      cout<<s.size()<<" ";
      for(int i=0;i<s.size();i++)
        cout<<(s[i]-'0'+1)<<" ";
      cout<<endl;
      cout<<k.size()<<" ";
      for(int i=0;i<k.size();i++)
        cout<<(k[i]-'0'+1)<<" ";
      
      return;
    }
  }
  cout<<"No"<<endl;
}
signed main()
{
    //#ifndef ONLINE_JUDGE
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    //freopen("error.txt" , "w" , stderr);
    //#endif 
    IOS
    int t=1,n;
    // cin>>t;
   
    while(t--)
    {
     solve();
    }
    
    return 0;
}