#include <iostream>

using namespace std;

typedef long long ll;

const int MOD = 1e9 + 7; 

struct Modint {
  ll val;
  
  Modint (ll _val = 0)
    : val(_val % MOD) {}

  Modint operator+ (Modint other) const {
    return Modint(val + other.val);
  }

  void operator+= (Modint other) {
    val += other.val;
    val %= MOD;
  }

  Modint operator- () const {
    return Modint(MOD - val);
  }

  Modint operator- (Modint other) const {
    return Modint(val + MOD - other.val);
  }

  void operator-= (Modint other) {
    val += MOD - other.val;
    val %= MOD;
  }

  Modint operator* (Modint other) const {
    return Modint(val * other.val);
  }

  void operator*= (Modint other) {
    val *= other.val;
    val %= MOD;
  }

  bool operator== (Modint other) const {
    return val == other.val;
  }

  bool operator!= (Modint other) const {
    return val != other.val;
  }
};

Modint exp (Modint a, int k) {
  if (k == 0) {
    return Modint(1);
  } else if (k % 2 == 0) {
    Modint half = exp(a, k / 2);
    return half * half;
  } else {
    return a * exp(a, k - 1);
  }
}

Modint inv (Modint a) {
  return exp(a, MOD - 2);
}

ostream& operator<< (ostream& out, Modint p) {
  out << p.val;
  return out;
}

const int MAX_N = 1e5 + 5;

int arr [MAX_N];
Modint sum [MAX_N][2];
Modint cnt [MAX_N][2];

int main () {
  ios::sync_with_stdio(false);

  int n;
  cin >> n;

  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }

  cnt[0][0] = Modint(1);
  sum[0][0] = Modint(arr[0]);

  for (int i = 1; i < n; i++) {
    cnt[i][0] = cnt[i - 1][0] + cnt[i - 1][1];
    sum[i][0] = sum[i - 1][0] + sum[i - 1][1] + cnt[i][0] * Modint(arr[i]);

    cnt[i][1] = cnt[i - 1][0];
    sum[i][1] = sum[i - 1][0] + cnt[i][1] * -Modint(arr[i]);
  }

  cout << sum[n - 1][0] + sum[n - 1][1] << '\n';
}

#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <iterator>
#include <deque>
#include <bitset>
#include <climits>
#include <algorithm>
#include <iomanip>
#include <stack>
#include <queue>
#include <cmath>
 
#define ll long long
#define mod 1000000007
//#define mod 998244353
#define pi pair< int,int >
#define pll pair<long long ,long long>
 
#define vi vector<int>
#define vll vector< long long  >
#define vb vector<bool>
#define vvi vector<vector<int> >
#define nl "\n"
#define mp make_pair
#define pb push_back
#define yes cout<<"YES"<<"\n"
#define no cout<<"NO"<<"\n"
 
#define for_ab(i,a,b) for(long long i=a ;i<b ;++i)
#define for_n( i , n) for_ab(i , 0ll , n)
#define all(v)  v.begin() , v.end()
 
using namespace std;
/*
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
#define ordered_set tree<int , null_type, less_equal<int> , rb_tree_tag ,tree_order_statistics_node_update>
*/
bool isprime(ll a){
	for(ll i=2;i<=pow(a,0.5);++i){
		if(a%i==0){
			return false;
		}
 
	}
	return true;
}
ll ceil(ll a, ll b){
	ll c=(a+b-1)/b;
	return c;
}
 
ll gcd(ll a , ll b){
	if(a==0){
		return b;
	}
	if(b==0){
		return a;
	}
	return gcd(b,a%b);
}
ll power_mod(ll a , ll b){
	if(b==0){
		return 1;
	}
	ll temp=power_mod(a , b/2);
	temp=(temp*temp)%mod;
	if(b%2){
		temp=(temp*a)%mod;
	}
	return temp;
}
/*ll NCR(ll n , ll r){
	n=fact[n];
	
	ll a=fact[r] , b=fact[n-r];
	a=power_mod(a,mod-2);
	b=power_mod(b , mod-2);
	a=(a*b)%mod;
	n=(n*a)%mod;
	return n;
 
}*/
void help(vi v){
	cout<<v.size()<<' ';
	for(int i:v){
		cout<<i<<' ';
	}
	cout<<nl;
}
int main(){
		ios::sync_with_stdio(0);
		cin.tie(0);
	/*	#ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif*/
		int t=1;
		//cin>>t;
		
        while(t--){

        	int n;cin>>n;
        	vi v(n);

        	for_n(i , n){
        		cin>>v[i];
        	}
        	vector<vector<int> > ans(200);

        	int curr=min(n,8);
        	vi total;
        	for_n(i , curr){
        		total.pb(v[i]);
        	}

        	for(int i=1;i<(1<<curr);++i){

        		vector<int>temp;
        		int sum=0;
        		for(int j=0;j<curr;++j){
        			if(i &(1<<j)){
        				temp.pb(j+1);
        				sum=(sum+total[j])%200;
        			}
        		}
        		if(ans[sum].size()){
        			yes;
        			help(temp);
        			help(ans[sum]);
        			return 0;
        		}
        		ans[sum]=temp;

        	}
        	no;
        	return 0;

        	
        	


        	}
        	
}