#include <cstdio>
#include <iostream>
#include <cstring>
#include <queue>
using namespace std;
# define rep(i,a,b) for(int i=(a); i<=(b); ++i)
# define drep(i,a,b) for(int i=(a); i>=(b); --i)
typedef long long int_;
inline int readint(){
	int a = 0; char c = getchar(), f = 1;
	for(; c<'0'||c>'9'; c=getchar())
		if(c == '-') f = -f;
	for(; '0'<=c&&c<='9'; c=getchar())
		a = (a<<3)+(a<<1)+(c^48);
	return a*f;
}
inline void writeint(int_ x){
	if(x > 9) writeint(x/10);
	putchar((x-x/10*10)^48);
}

const int MaxN = 100005;
const int Mod = 1e9+7;
int a[MaxN], f[MaxN];

int main(){
	int n = readint();
	f[0] = 1, f[1] = 2;
	rep(i,2,n)
		f[i] = (f[i-1]+f[i-2])%Mod;
	a[1] = readint();
	int ans = 1ll*a[1]*f[n-1]%Mod;
	rep(i,2,n){
		a[i] = readint();
		int t = 1ll*f[max(i-3,0)]*f[max(n-i-1,0)]%Mod; // '-'
		t = (1ll*f[i-2]*f[n-i]%Mod+Mod-t)%Mod; // +
		ans = (ans+1ll*t*a[i])%Mod;
	}
	printf("%d\n",ans);
	return 0;
}

#include<bits/stdc++.h>

typedef   long long  int ll;
typedef  long double ld;
typedef std::vector<ll> vi;
typedef std::vector<std::vector<ll> > vv;
typedef std::vector<std::pair<ll,ll> > pii;

#define mod 1000000007
#define IO ios_base::sync_with_stdio(false);cin.tie(NULL);
#define fo(i,a,b) for(i=a;i<b;i++)
#define forr(i,a,b) for(i=a;i>=b;i--)
#define mp make_pair
#define pb(x) push_back(x)
#define fi first
#define se second
#define print(vec,a,b) for(ll i=a;i<b;i++) cout<<vec[i]<<" ";cout<<endl;
#define all(a) a.begin(),a.end()
#define input(vec,a,b) for(ll i = a;i<b;i++) cin>>vec[i];
#define ms(a,val) memset(a,val,sizeof(a))
using namespace std;

const int N = 2e5+ 5;



ll expo_pow(ll x, ll y) {
	if (y == 0)
		return 1;
	y = y % (mod - 1);
	x %= mod;
	if (y == 0)
		y = mod - 1;
	ll res = 1;
	while (y) {
		if (y & 1)
			res = (res * x) % mod;
		x = (x * x) % mod;
		y >>= 1;
	}
	return res;
}
 
ll modInverse(ll a, ll m = mod) {
	return expo_pow(a, m - 2);
}
	


void solve(){
            ll i,j,n,m,k;
			cin>>n;
			
			vi a(n,0);
			input(a,0,n);
			
			map<ll, vector<ll> > M;
			
			i = 1;
			bool done = false;
			while( i < 202)
			{
				if( n < 10 && i == (1LL<<n))
				  break;
				
				vi temp;
				ll sum = 0;
				fo(j,0,min(n,16LL))
				{
					if((1LL<<j)&i)
					{
						sum+=a[j];
						temp.pb(j+1);
					}
				}
				sum = sum%200;
				if(M.find(sum) != M.end())
				{
					done = true;
					cout<<"Yes"<<endl;
					cout<<M[sum].size()<<" ";
					for(auto it : M[sum])
					 cout<<it<<" ";
					cout<<endl;
					//sort(all(temp));
					cout<<temp.size()<<" ";
					for(auto it : temp)
					 cout<<it<<" ";
					cout<<endl;
					return ;
				}
				else
				{
					//sort(all(temp));
					M[sum] = temp;
				}
				i++;
			}
			cout<<"No"<<endl;
				
			
            
				
            
            
            
           
			
			
            
            
            
            
            
            
            
            
            
            
            
            
           
}



int main()
{
     IO;
      ll t=1,i;
      //cin>>t;

		
      while(t--)
      {

          solve();
      }
    return 0;
}
