stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#pragma GCC optimize ("-O3")

#include <bits/stdc++.h>

// #include <ext/pb_ds/assoc_container.hpp>

// #include <ext/pb_ds/tree_policy.hpp>

// using namespace __gnu_pbds;

//#include <boost/multiprecision/cpp_int.hpp>

//using namespace boost::multiprecision;

using namespace std;



#define all(c) (c).begin(),(c).end()

#define endl "\n"

#define ff first

#define ss second

#define allr(c) (c).rbegin(),(c).rend()

#define ifr(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))

#define pof pop_front

#define pob pop_back

#define pb emplace_back

#define pf emplace_front

#define fstm(m,n,r) m.reserve(n);m.max_load_factor(r)

#define mp make_pair

#define mt make_tuple

#define inf LLONG_MAX

#define os tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>

//order_of_key (k) : Number of items strictly smaller than k .

//find_by_order(k) : K-th element in a set (counting from zero).

const double PI = acos(-1);

typedef complex<double> cd;

typedef long long ll;

ll gcd(){return 0ll;} template<typename T,typename... Args> T gcd(T a,Args... args) { return __gcd(a,(__typeof(a))gcd(args...)); }

typedef map<ll,ll> mll;

typedef map<string,ll> msll;

typedef unordered_map<ll,ll> umap;

typedef vector<ll> vll;

typedef pair<ll,ll> pll;

typedef long double ld;

#define mod 1000000007 

#define N 100001



ll dp[N],a[101];



ll fun(ll n,ll k) {

    if(dp[k]!=-1) return dp[k];

    set<int> s;

    ifr(i,0,n) {

        if(k<a[i]) continue;

        s.insert(fun(n,k-a[i]));

    }

    int mex=0;

    while(s.find(mex)!=s.end()) mex++;

    dp[k]=mex;

    return mex;

}



int main() {

    ios_base::sync_with_stdio(false);

    cin.tie(NULL);

    cout.tie(NULL);



    int n,k;

    cin>>n>>k;

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

    ifr(i,0,N) dp[i]=-1;

    fun(n,k);

    if(dp[k]) cout<<"First\n";

    else cout<<"Second\n";

    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.8349758228001545x):
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

#define cu continue

#define pb push_back

#define mp make_pair

#define mod 1000000007

#define inf 1000000000

#define pll pair <ll,ll>

#define min_pq priority_queue <pll> ,vector <pll>, greater <pll> > > 

#define f first

#define s second

#define vll vector <ll>

#define dbg(n) cout<<n<<' ';



int main()

{

    ios_base::sync_with_stdio(false);

    cin.tie(NULL);

    cout.tie(NULL);



    ll n,k;

    cin>>n>>k;

    ll a[n];

    for(ll i=0;i<n;i++)

        cin>>a[i];

    ll dp[k+1];

    memset(dp,0,sizeof dp);

    for(ll j=1;j<=k;j++)

    {

        for(ll i=0;i<n;i++)

        {

            if(j-a[i]<0)

                cu;

            dp[j]=(dp[j-a[i]]^1)|(dp[j]);

        }

    }

    if(dp[k]&1)

        cout<<"First\n";

    else

        cout<<"Second\n";

}
// Slower C++ solution:
// 26/01/20 // 10:06 AM //



#include <bits/stdc++.h>



using namespace std;



const int MAXN = (int)(1e2) + 10;

const int MAXK = (int)(1e5) + 10;



int n, k;

int a[MAXN], memo[2][MAXK];



int solve(int p, int h){ // player, height



    //printf("solve(%d, %d) = %d\n", p, h, memo[p][h]);



    if(memo[p][h]!=-1) return memo[p][h];



    memo[p][h] = !p;



    for(int i=0; i<n; i++)

        if(h-a[i]>=0){

            if(p==0)

                memo[p][h] = min(memo[p][h], solve(1, h-a[i]));

            else

                memo[p][h] = max(memo[p][h], solve(0, h-a[i]));

        }



    return memo[p][h];

}



int solve_bottom_up(){



    for(int p=0; p<2; p++){

        for(int h=0; h<=k; h++){

            memo[p][h] = !p;



            for(int i=0; i<n; i++)

                if(h-a[i]>=0){

                    if(p==0)

                        memo[p][h] = min(memo[p][h], solve(1, h-a[i]));

                    else

                        memo[p][h] = max(memo[p][h], solve(0, h-a[i]));

                }

        }

    }



    return memo[0][k];

}



int main(){

    ios_base::sync_with_stdio(false);

    cin.tie(NULL);



    memset(memo, -1, sizeof(memo));



    cin >> n >> k;

    for(int i=0; i<n; i++) cin >> a[i];

    //sort(a, a+n);



    cout << (solve_bottom_up()?"Second":"First") << endl;



    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.2436509338725004x):
// 26/01/20 // 10:06 AM //



#include <bits/stdc++.h>



using namespace std;



const int MAXN = (int)(1e2) + 10;

const int MAXK = (int)(1e5) + 10;



int n, k;

int a[MAXN], memo[MAXK];



int solve(int h){ // player, height

    if(memo[h]!=-1) return memo[h];



    if(!h) return memo[h] = 0;



    memo[h] = 0;



    for(int i=0; i<n && a[i]<=h; i++){

        memo[h] = !solve(h-a[i]);



        if(memo[h]) break;

    }



    return memo[h];

}



int main(){

    ios_base::sync_with_stdio(false);

    cin.tie(NULL);



    memset(memo, -1, sizeof(memo));



    cin >> n >> k;

    for(int i=0; i<n; i++) cin >> a[i];



    cout << (solve(k)?"First":"Second") << endl;



    return 0;

}
// Slower C++ solution:
// 26/01/20 // 10:06 AM //



#include <bits/stdc++.h>



using namespace std;



const int MAXN = (int)(1e2) + 10;

const int MAXK = (int)(1e5) + 10;



int n, k;

int a[MAXN], memo[2][MAXK];



int solve(int p, int h){ // player, height



    //printf("solve(%d, %d) = %d\n", p, h, memo[p][h]);



    if(memo[p][h]!=-1) return memo[p][h];



    memo[p][h] = !p;



    for(int i=0; i<n; i++)

        if(h-a[i]>=0){

            if(p==0)

                memo[p][h] = min(memo[p][h], solve(1, h-a[i]));

            else

                memo[p][h] = max(memo[p][h], solve(0, h-a[i]));

        }



    return memo[p][h];

}



int solve_bottom_up(){



    for(int p=0; p<2; p++){

        for(int h=0; h<=k; h++){

            memo[p][h] = !p;



            for(int i=0; i<n; i++)

                if(h-a[i]>=0){

                    if(p==0)

                        memo[p][h] = min(memo[p][h], solve(1, h-a[i]));

                    else

                        memo[p][h] = max(memo[p][h], solve(0, h-a[i]));

                }

        }

    }



    return memo[0][k];

}



int main(){

    ios_base::sync_with_stdio(false);

    cin.tie(NULL);



    memset(memo, -1, sizeof(memo));



    cin >> n >> k;

    for(int i=0; i<n; i++) cin >> a[i];

    //sort(a, a+n);



    cout << (solve_bottom_up()?"Second":"First") << endl;



    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.8213695677854829x):
// 26/01/20 // 10:06 AM //



#include <bits/stdc++.h>



using namespace std;



const int MAXN = (int)(1e2) + 10;

const int MAXK = (int)(1e5) + 10;



int n, k;

int a[MAXN], memo[MAXK];



int main(){

    ios_base::sync_with_stdio(false);

    cin.tie(NULL);



    cin >> n >> k;

    for(int i=0; i<n; i++) cin >> a[i];



    // solve(){

    for(int h=1; h<=k; h++){

        for(int i=0; i<n && a[i]<=h; i++){

            memo[h] = !memo[h-a[i]];



            if(memo[h]) break;

        }

    }

    //}



    cout << (memo[k]?"First":"Second") << endl;



    return 0;

}
// Slower C++ solution:
// 26/01/20 // 10:06 AM //



#include <bits/stdc++.h>



using namespace std;



const int MAXN = (int)(1e2) + 10;

const int MAXK = (int)(1e5) + 10;



int n, k;

int a[MAXN], memo[MAXK];



int solve(int h){ // player, height

    if(memo[h]!=-1) return memo[h];



    if(!h) return memo[h] = 0;



    memo[h] = 0;



    for(int i=0; i<n && a[i]<=h; i++){

        memo[h] = !solve(h-a[i]);



        if(memo[h]) break;

    }



    return memo[h];

}



int main(){

    ios_base::sync_with_stdio(false);

    cin.tie(NULL);



    memset(memo, -1, sizeof(memo));



    cin >> n >> k;

    for(int i=0; i<n; i++) cin >> a[i];



    cout << (solve(k)?"First":"Second") << endl;



    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.4645343948032692x):
// 26/01/20 // 10:06 AM //



#include <bits/stdc++.h>



using namespace std;



const int MAXN = (int)(1e2) + 10;

const int MAXK = (int)(1e5) + 10;



int n, k;

int a[MAXN], memo[MAXK];



int main(){

    ios_base::sync_with_stdio(false);

    cin.tie(NULL);



    cin >> n >> k;

    for(int i=0; i<n; i++) cin >> a[i];



    // solve(){

    for(int h=1; h<=k; h++){

        for(int i=0; i<n && a[i]<=h; i++){

            memo[h] = !memo[h-a[i]];



            if(memo[h]) break;

        }

    }

    //}



    cout << (memo[k]?"First":"Second") << endl;



    return 0;

}
// Slower C++ solution:
// 26/01/20 // 10:06 AM //



#include <bits/stdc++.h>



using namespace std;



const int MAXN = (int)(1e2) + 10;

const int MAXK = (int)(1e5) + 10;



int n, k;

int a[MAXN], memo[2][MAXK];



int solve(int p, int h){ // player, height



    //printf("solve(%d, %d) = %d\n", p, h, memo[p][h]);



    if(memo[p][h]!=-1) return memo[p][h];



    memo[p][h] = !p;



    for(int i=0; i<n; i++)

        if(h-a[i]>=0){

            if(p==0)

                memo[p][h] = min(memo[p][h], solve(1, h-a[i]));

            else

                memo[p][h] = max(memo[p][h], solve(0, h-a[i]));

        }



    return memo[p][h];

}



int solve_bottom_up(){



    for(int p=0; p<2; p++){

        for(int h=0; h<=k; h++){

            memo[p][h] = !p;



            for(int i=0; i<n; i++)

                if(h-a[i]>=0){

                    if(p==0)

                        memo[p][h] = min(memo[p][h], solve(1, h-a[i]));

                    else

                        memo[p][h] = max(memo[p][h], solve(0, h-a[i]));

                }

        }

    }



    return memo[0][k];

}



int main(){

    ios_base::sync_with_stdio(false);

    cin.tie(NULL);



    memset(memo, -1, sizeof(memo));



    cin >> n >> k;

    for(int i=0; i<n; i++) cin >> a[i];

    //sort(a, a+n);



    cout << (solve_bottom_up()?"Second":"First") << endl;



    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.814680479648794x):
// 26/01/20 // 10:06 AM //



#include <bits/stdc++.h>



using namespace std;



const int MAXN = (int)(1e2) + 10;

const int MAXK = (int)(1e5) + 10;



int n, k;

int a[MAXN], memo[MAXK];



int main(){

    ios_base::sync_with_stdio(false);

    cin.tie(NULL);



    cin >> n >> k;

    for(int i=0; i<n; i++) cin >> a[i];



    for(int h=1; h<=k; h++)

        for(int i=0; i<n && a[i]<=h && !memo[h]; i++)

            memo[h] = !memo[h-a[i]];



    cout << (memo[k]?"First\n":"Second\n");



    return 0;

}
// Slower C++ solution:
// 26/01/20 // 10:06 AM //



#include <bits/stdc++.h>



using namespace std;



const int MAXN = (int)(1e2) + 10;

const int MAXK = (int)(1e5) + 10;



int n, k;

int a[MAXN], memo[MAXK];



int solve(int h){ // player, height

    if(memo[h]!=-1) return memo[h];



    if(!h) return memo[h] = 0;



    memo[h] = 0;



    for(int i=0; i<n && a[i]<=h; i++){

        memo[h] = !solve(h-a[i]);



        if(memo[h]) break;

    }



    return memo[h];

}



int main(){

    ios_base::sync_with_stdio(false);

    cin.tie(NULL);



    memset(memo, -1, sizeof(memo));



    cin >> n >> k;

    for(int i=0; i<n; i++) cin >> a[i];



    cout << (solve(k)?"First":"Second") << endl;



    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.4591558050764395x):
// 26/01/20 // 10:06 AM //



#include <bits/stdc++.h>



using namespace std;



const int MAXN = (int)(1e2) + 10;

const int MAXK = (int)(1e5) + 10;



int n, k;

int a[MAXN], memo[MAXK];



int main(){

    ios_base::sync_with_stdio(false);

    cin.tie(NULL);



    cin >> n >> k;

    for(int i=0; i<n; i++) cin >> a[i];



    for(int h=1; h<=k; h++)

        for(int i=0; i<n && a[i]<=h && !memo[h]; i++)

            memo[h] = !memo[h-a[i]];



    cout << (memo[k]?"First\n":"Second\n");



    return 0;

}
// Slower C++ solution:
#include "bits/stdc++.h"

using namespace std;

#define ll long long int

#define rep(i,n) for( int i = 0; i < n; i++ )

#define rrep(i,n) for( int i = n; i >= 0; i-- )

#define REP(i,s,t) for( int i = s; i <= t; i++ )

#define RREP(i,s,t) for( int i = s; i >= t; i-- )

#define dump(x)  cerr << #x << " = " << (x) << endl;

#define INF 2000000000

#define mod 1000000007

#define INF2 1000000000000000000

int N;

int dp[2][100010];

int a[110];



int dfs(int stone, int turn) {

    if (dp[turn][stone] != -1) return dp[turn][stone];

    rep(i, N) {

        if (stone - a[i] >= 0 && dfs(stone - a[i], !turn ) == turn) {

            return dp[turn][stone] = turn;

        }

    }

    return dp[turn][stone] = !turn;

}





int main(void)

{

    cin.tie(0);

    ios::sync_with_stdio(false);

    int K;

    cin >> N >> K;

    rep(i, N) cin >> a[i];

    rep(i, 2) rep(j, 100010) dp[i][j] = -1;

    if (dfs(K, 1)) cout << "First" << endl;

    else cout << "Second" << endl;



    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.9280252807938065x):
#include "bits/stdc++.h"

using namespace std;

#define ll long long int

#define rep(i,n) for( int i = 0; i < n; i++ )

#define rrep(i,n) for( int i = n; i >= 0; i-- )

#define REP(i,s,t) for( int i = s; i <= t; i++ )

#define RREP(i,s,t) for( int i = s; i >= t; i-- )

#define dump(x)  cerr << #x << " = " << (x) << endl;

#define INF 2000000000

#define mod 1000000007

#define INF2 1000000000000000000



bool dp[100010];



int main(void)

{

    cin.tie(0);

    ios::sync_with_stdio(false);

    int N, K; cin >> N >> K;

    int a[100010];

    rep(i, N) cin >> a[i];

    REP(j, 1, K) {

        rep(i, N) {

            if (j - a[i] >= 0) {

                dp[j] = dp[j] | !(dp[j - a[i]]); 

            }

        }

    }

    //rep(i, K) cout << dp[j] << endl;

    //cout << dp[K] << endl;

    if (dp[K]) cout << "First" << endl;

    else cout << "Second" << endl;



    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

#define rep(i, l, r) for (register int i = l; i <= r; i++)

#define per(i, r, l) for (register int i = r; i >= l; i--)

#define srep(i, l, r) for (register int i = l; i < r; i++)

#define sper(i, r, l) for (register int i = r; i > l; i--)

#define erep(i, x) for (register int i = h[x]; i; i = e[i].next)

#define erep2(i, x) for (register int& i = cur[x]; i; i = e[i].next)

#define pii pair<int, int>

#define pll pair<ll, ll>

#define pdd pair<double, double>

#define fi first

#define se second

#define ui unsigned int

#define ld long double

#define ll long long int 

#define pb push_back

#define pc putchar

#define lowbit(x) (x & -x)

#define maxr 2000020

#define maxn

#define maxm

#define maxs

#define maxb

#define M 

#define gc() ((p1 == p2 && (p2 = (p1 = buffer) + fread(buffer, 1, maxr, stdin), p1 == p2)) ? EOF : *p1++)

using namespace std;



char buffer[maxr], *p1, *p2;

template <class T> void read(T& x){

	char ch = gc(); x = 0; bool f = 1;

	while (!('0' <= ch && ch <= '9') && ch != '-') ch = gc();

	if (ch == '-') f = 0, ch = gc();

	while ('0' <= ch && ch <= '9') x = (x << 1) + (x << 3) + ch - '0', ch = gc();

	x = (f) ? x : -x;

}

int _num[20];

template <class T> void write(T x){	

	if (!x) {putchar('0'), putchar('\n'); return;}

	if (x < 0) putchar('-'), x = -x;

	int c = 0;

	while (x) _num[++c] = x % 10, x /= 10;

	while (c) putchar('0' + _num[c--]); 

	putchar('\n');

}



int n;

int main(){

	int x, mx = 0, sum = 0;

	scanf("%d", &n); rep(i, 1, n) scanf("%d", &x), mx = max(mx, x), sum += x; 

	if (2 * mx >= sum) printf("No");

	else printf("Yes");

	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.212637981252292x):
#include<stdio.h>

#include <stdlib.h>

#define size 12

int comp(int *c,int *d)

{

    return (*d-*c);

}

int main()

{

    int a[size],n,i,j,sum=0,t;

    scanf("%d",&n);

    for(i=0;i<n;i++)

    {

        scanf("%d",&a[i]);

    }

    //qsort(a,n,sizeof(int),comp);

    for(i=0;i<n;i++)

    {

        for(j=i+1;j<n;j++)

        {

            if(a[i]<a[j])

            {

                t=a[i];a[i]=a[j];a[j]=t;

            }

        }

    }

    for(i=1;i<n;i++)

    {

        sum+=a[i];

    }

    if(sum>a[0])printf("Yes");

    else printf("No");

}
// Slower C++ solution:
#include <iostream>

#include <stack>

using namespace std;

int max(int a,int b)

{

    if (a>b)

    {

        return a;

    }

    else

    {

        return b;

    }

}

int main()

{

    int n=0;

    cin>>n;

    int a[n];

    for(int i=0;i!=n;i++)

    {

        cin>>a[i];

    }

    int max=a[0];

    int sum=0;

    for(int i=1;i!=n;i++)

    {

        if(a[i]>max)

        {

            sum+=max;

            max=a[i];

        }

        else

        {

            sum+=a[i];

        }

    }

    if(max>=sum)

    {

        cout<<"No"<<endl;

    }

    else{

        cout<<"Yes"<<endl;

    }

}




// Faster C++ solution for the same problem (measured speedup: 5.286229806746607x):
#include<stdio.h>

#include <stdlib.h>

#define size 12

int comp(int *c,int *d)

{

    return (*d-*c);

}

int main()

{

    int a[size],n,i,j,sum=0,t;

    scanf("%d",&n);

    for(i=0;i<n;i++)

    {

        scanf("%d",&a[i]);

    }

    //qsort(a,n,sizeof(int),comp);

    for(i=0;i<n;i++)

    {

        for(j=i+1;j<n;j++)

        {

            if(a[i]<a[j])

            {

                t=a[i];a[i]=a[j];a[j]=t;

            }

        }

    }

    for(i=1;i<n;i++)

    {

        sum+=a[i];

    }

    if(sum>a[0])printf("Yes");

    else printf("No");

}
// Slower C++ solution:
#include <bits/stdc++.h>

#define rep(i, l, r) for (register int i = l; i <= r; i++)

#define per(i, r, l) for (register int i = r; i >= l; i--)

#define srep(i, l, r) for (register int i = l; i < r; i++)

#define sper(i, r, l) for (register int i = r; i > l; i--)

#define erep(i, x) for (register int i = h[x]; i; i = e[i].next)

#define erep2(i, x) for (register int& i = cur[x]; i; i = e[i].next)

#define pii pair<int, int>

#define pll pair<ll, ll>

#define pdd pair<double, double>

#define fi first

#define se second

#define ui unsigned int

#define ld long double

#define ll long long int 

#define pb push_back

#define pc putchar

#define lowbit(x) (x & -x)

#define maxr 2000020

#define maxn

#define maxm

#define maxs

#define maxb

#define M 

#define gc() ((p1 == p2 && (p2 = (p1 = buffer) + fread(buffer, 1, maxr, stdin), p1 == p2)) ? EOF : *p1++)

using namespace std;



char buffer[maxr], *p1, *p2;

template <class T> void read(T& x){

	char ch = gc(); x = 0; bool f = 1;

	while (!('0' <= ch && ch <= '9') && ch != '-') ch = gc();

	if (ch == '-') f = 0, ch = gc();

	while ('0' <= ch && ch <= '9') x = (x << 1) + (x << 3) + ch - '0', ch = gc();

	x = (f) ? x : -x;

}

int _num[20];

template <class T> void write(T x){	

	if (!x) {putchar('0'), putchar('\n'); return;}

	if (x < 0) putchar('-'), x = -x;

	int c = 0;

	while (x) _num[++c] = x % 10, x /= 10;

	while (c) putchar('0' + _num[c--]); 

	putchar('\n');

}



int n;

int main(){

	int x, mx = 0, sum = 0;

	scanf("%d", &n); rep(i, 1, n) scanf("%d", &x), mx = max(mx, x), sum += x; 

	if (2 * mx >= sum) printf("No");

	else printf("Yes");

	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.211806731914882x):
#include <stdio.h>



int main()



{



int n,max=-1,sum=0,p,i,j;

int m[1000];



scanf("%d ",&n);



for(i=0;i<n;i++)

{

scanf("%d",&m[i]);

}

for(i=0;i<n;i++)

{

if(m[i]>max)

{

max=m[i];

}

}





for(j=0;j<n;j++)



{

sum=sum+m[j];



}





 p=sum-max;



if(p>max)

{

printf("Yes\n") ;

}

else

printf("No\n");





return 0;

}
// Slower C++ solution:
#include <iostream>

#include <stack>

using namespace std;

int max(int a,int b)

{

    if (a>b)

    {

        return a;

    }

    else

    {

        return b;

    }

}

int main()

{

    int n=0;

    cin>>n;

    int a[n];

    for(int i=0;i!=n;i++)

    {

        cin>>a[i];

    }

    int max=a[0];

    int sum=0;

    for(int i=1;i!=n;i++)

    {

        if(a[i]>max)

        {

            sum+=max;

            max=a[i];

        }

        else

        {

            sum+=a[i];

        }

    }

    if(max>=sum)

    {

        cout<<"No"<<endl;

    }

    else{

        cout<<"Yes"<<endl;

    }

}




// Faster C++ solution for the same problem (measured speedup: 5.2853868218625495x):
#include <stdio.h>



int main()



{



int n,max=-1,sum=0,p,i,j;

int m[1000];



scanf("%d ",&n);



for(i=0;i<n;i++)

{

scanf("%d",&m[i]);

}

for(i=0;i<n;i++)

{

if(m[i]>max)

{

max=m[i];

}

}





for(j=0;j<n;j++)



{

sum=sum+m[j];



}





 p=sum-max;



if(p>max)

{

printf("Yes\n") ;

}

else

printf("No\n");





return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

#define rep(i, l, r) for (register int i = l; i <= r; i++)

#define per(i, r, l) for (register int i = r; i >= l; i--)

#define srep(i, l, r) for (register int i = l; i < r; i++)

#define sper(i, r, l) for (register int i = r; i > l; i--)

#define erep(i, x) for (register int i = h[x]; i; i = e[i].next)

#define erep2(i, x) for (register int& i = cur[x]; i; i = e[i].next)

#define pii pair<int, int>

#define pll pair<ll, ll>

#define pdd pair<double, double>

#define fi first

#define se second

#define ui unsigned int

#define ld long double

#define ll long long int 

#define pb push_back

#define pc putchar

#define lowbit(x) (x & -x)

#define maxr 2000020

#define maxn

#define maxm

#define maxs

#define maxb

#define M 

#define gc() ((p1 == p2 && (p2 = (p1 = buffer) + fread(buffer, 1, maxr, stdin), p1 == p2)) ? EOF : *p1++)

using namespace std;



char buffer[maxr], *p1, *p2;

template <class T> void read(T& x){

	char ch = gc(); x = 0; bool f = 1;

	while (!('0' <= ch && ch <= '9') && ch != '-') ch = gc();

	if (ch == '-') f = 0, ch = gc();

	while ('0' <= ch && ch <= '9') x = (x << 1) + (x << 3) + ch - '0', ch = gc();

	x = (f) ? x : -x;

}

int _num[20];

template <class T> void write(T x){	

	if (!x) {putchar('0'), putchar('\n'); return;}

	if (x < 0) putchar('-'), x = -x;

	int c = 0;

	while (x) _num[++c] = x % 10, x /= 10;

	while (c) putchar('0' + _num[c--]); 

	putchar('\n');

}



int n;

int main(){

	int x, mx = 0, sum = 0;

	scanf("%d", &n); rep(i, 1, n) scanf("%d", &x), mx = max(mx, x), sum += x; 

	if (2 * mx >= sum) printf("No");

	else printf("Yes");

	return 0;

}


// Faster C++ solution for the same problem (measured speedup: 5.222875970836776x):
#include<stdio.h>



int main()

{

    int N, L[101], max=-1, i, sum=0, count=0;



    scanf("%d", &N);





    for(i=0; i<N; i++){

        scanf("%d", &L[i]);



        if(L[i]>max)

            max=L[i];

    }



    for(i=0; i<N; i++){

        if(count==0)

            if(max==L[i]){

                count++;

                continue;

            }



        sum += L[i];

    }



    if(max < sum)

        printf("Yes\n");

    else

        printf("No\n");



    return 0;

}
// Slower C++ solution:
#include <iostream>

#include <stack>

using namespace std;

int max(int a,int b)

{

    if (a>b)

    {

        return a;

    }

    else

    {

        return b;

    }

}

int main()

{

    int n=0;

    cin>>n;

    int a[n];

    for(int i=0;i!=n;i++)

    {

        cin>>a[i];

    }

    int max=a[0];

    int sum=0;

    for(int i=1;i!=n;i++)

    {

        if(a[i]>max)

        {

            sum+=max;

            max=a[i];

        }

        else

        {

            sum+=a[i];

        }

    }

    if(max>=sum)

    {

        cout<<"No"<<endl;

    }

    else{

        cout<<"Yes"<<endl;

    }

}




// Faster C++ solution for the same problem (measured speedup: 5.296612335880091x):
#include<stdio.h>



int main()

{

    int N, L[101], max=-1, i, sum=0, count=0;



    scanf("%d", &N);





    for(i=0; i<N; i++){

        scanf("%d", &L[i]);



        if(L[i]>max)

            max=L[i];

    }



    for(i=0; i<N; i++){

        if(count==0)

            if(max==L[i]){

                count++;

                continue;

            }



        sum += L[i];

    }



    if(max < sum)

        printf("Yes\n");

    else

        printf("No\n");



    return 0;

}