#include <bits/stdc++.h>

using namespace std;

#define FASTIO ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define FASTIO1 srand(chrono::high_resolution_clock::now().time_since_epoch().count())
#define gc getchar_unlocked
#define ll long long
#define PI 3.1415926535897932384626
#define br cout << endl
#define sp cout << " "
#define foin(i, s, e) for (i = s; i < e; i++)
#define Fo(i, k, n) for (i = k; k < n ? i < n : i > n; k < n ? i += 1 : i -= 1)
#define printarr(i, s, e, a, str) fin(i, s, e) cout << a[i] << str;
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define clr(x) memset(x, 0, sizeof(x))
#define tr(it, x) for (auto it = x.begin(); it != x.end(); it++)
#define trr(it, x) for (auto it = x.rbegin(); it != x.rend(); it +)
#define sortv(vec) sort(vec.begin(), vec.end());

typedef pair<int, int> pii;
typedef map<int, int> mapii;
typedef pair<ll, ll> pl;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<pii> vpii;
typedef vector<pl> vpl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;

const int mod = 1'000'000'007;
const int N = 3e5;
int i = 0;

mt19937_64 rang(chrono::high_resolution_clock::now().time_since_epoch().count());
int rng(int lim)
{
    uniform_int_distribution<int> uid(0, lim - 1);
    return uid(rang);
}

/* ========== Solution ========= */

int main()
{
    FASTIO;
    FASTIO1;

    int n = 1;
    cin >> n;

    int a[n], b[n];

    foin(i, 0, n)
            cin >>
        a[i];
    foin(i, 0, n)
            cin >>
        b[i];

    int s = a[0], e = b[0];

    foin(i, 1, n)
    {
        if (a[i] > s)
            s = a[i];
        if (b[i] < e)
            e = b[i];
    }
    if (s > e)
        cout << "0";
    else
        cout << (e - s + 1);

    return 0;
}
#include <bits/stdc++.h>
#define arr array 
#define pb push_back
#define fs first 
#define sc second
#define eb emplace_back
#define vt vector
#define all(x) (x).begin(), (x).end()
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))

using namespace std;
typedef long long ll;
const int maxn=1e5;
const ll MAXLL=9223372036854775807;

void solve(){
	int n;
	cin >> n;
	vt<int> a(n);
	rep(i, 0, n) cin >> a[i], a[i]%=200;
	int li=min(8, n);
	map<int, vt<vt<int>>> mp;
	for (int mask=1; mask<(1<<li); mask++){
		vt<int> v;
		int s=0;
		rep(i, 0, li)
			if (mask>>i&1) s+=a[i], v.pb(i+1);
		if (!mp[s%200].empty()){
			vt<int> v1=mp[s%200][0];
			cout << "Yes" << endl;
			cout << (int)v.size() << " "; for (auto i:v) cout << i << " "; cout << endl;
			cout << (int)v1.size() << " "; for (auto i:v1) cout << i << " "; cout << endl;
			return;
		} else mp[s%200].pb(v);
	}	
	cout << "No";
}

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
	solve();
}
