#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<map>
#include<stack>
#include<queue>
#include<ctime>
#include<vector>
#include<set>
#include<cstdlib>
#include<utility>
using namespace std;
const int mod=1e9+7;
int a[100000+5];
int main()
{
    int n,i,ans=1;
    scanf("%d",&n);
    for (i=1;i<=n;i++)
        scanf("%d",&a[i]);
    sort(a+1,a+n+1);
    for (i=n;i>=2;i--)
        a[i]-=a[i-1];
    for (i=1;i<=n;i++)
        ans=1ll*ans*(a[i]+1)%mod;
    printf("%d\n",ans);
}

#include <bits/stdc++.h>
#define pb push_back
#define sz size()
#define all(c) (c).begin(), (c).end()

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const int MOD = 1e9 + 7;
const int maxn = 2e5 + 7;
int cnt[200];
vector<int> g[200];
void solve(){
    int n;
    cin >> n;
    vector<int> a(n);
    for(int i = 0; i < n; i++)cin >> a[i];
    for(int i = 0; i < n; i++)a[i] %= 200;
    int s = min(8, n);
    for(int mask = 0; mask < (1 << s); mask++){
        int rem = 0;
        vector<int> e;
        for(int bit = 0; bit < s; bit++){
            if(mask & (1 << bit)){
                rem = (rem + a[bit]) % 200;
                e.pb(bit + 1);
            }
        }
        if(g[rem].sz != 0){
            cout << "YES\n";
            cout << e.sz << ' ';
            for(int i : e)cout << i << ' ';
            cout << '\n';
            cout << g[rem].sz << ' ';
            for(int i : g[rem])cout << i << ' ';
            return;
        } else{
            g[rem] = e;
        }
    }
    cout << "NO\n";
}
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    solve();
    return 0;
}