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

//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse4")

#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define RFOR(i, b, a) for(int i = (b) - 1; i >= (a); --i)

#define SZ(a) (int)((a).size())
#define ALL(a) a.begin(), a.end()

typedef long long LL;
typedef pair<int, int> PII;

const int MAX = 51;

bool p[MAX];
LL a[MAX];

int main()
{
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	FOR(i, 2, MAX)
		p[i] = true;
	vector<int> primes;
	FOR(i, 2, MAX)
		if(p[i])
		{
			for(int j = 2 * i; j < MAX; j += i)
				p[j] = false;
			primes.push_back(i);
		}
	int n;
	cin >> n;
	FOR(i, 0, n)
		cin >> a[i];
	LL ans = LONG_LONG_MAX;
	FOR(mask, 0, 1 << SZ(primes))
	{
		LL cur = 1;
		FOR(i, 0, SZ(primes))
			if((mask >> i) & 1)
				cur *= primes[i];
		bool ok = true;
		FOR(i, 0, n)
			ok &= __gcd(cur, a[i]) > 1;
		if(ok)
			ans = min(ans, cur);
	}
	cout << ans << "\n";
	return 0;
}

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

const int maxn=330;
vector<int> vec[maxn];
int n;
int a[maxn];
int tot;
int tmp[maxn];

int main(){;
    cin>>n;
    for(int i=0;i<n;i++) cin>>a[i],a[i]%=200;
    int up=min(8,n),fl=0;
    for(int p=0;p<(1<<up)&&fl==0;p++){
        int cur=0;
        tot=0;
        for(int i=0;i<up;i++){
            if((p>>i)&1) cur=(cur+a[i])%200,tmp[tot++]=i;
        }
        if(vec[cur].size()){
            cout<<"YES";
            cout<<"\n"<<(int)vec[cur].size();
            for(int i=0;i<vec[cur].size();i++) cout<<" "<<vec[cur][i]+1;
            cout<<"\n"<<tot;
            for(int i=0;i<tot;i++) cout<<" "<<tmp[i]+1;
            fl=1;
        }
        else {
            for(int i=0;i<tot;i++) vec[cur].push_back(tmp[i]);
        }
    }
    if(!fl) cout<<"NO\n";
    return 0;
}
