stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;

#define endl '\n'

int n,k,arr[101],mi=10000000;

int dp[100010];

int dfs(int u){

	if(u<mi)return 0;

	int &res=dp[u];

	if(~res)return res;

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

		if(u>=arr[i] && !dfs(u-arr[i]))return res=1;

	}

	return res=0;

}



int main()

{

	ios_base::sync_with_stdio(false);

	cin.tie(0);

	cout.tie(0);

	memset(dp,-1,sizeof dp);

	cin>>n>>k;

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

		cin>>arr[i];

		mi=min(arr[i],mi);

	}



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





	return 0;

}

// Optimized solution to the same problem (faster):
#include<bits/stdc++.h>

using namespace std;

vector<int> vi;

int n, k, no;

const int MAX=1e5+3;

bool dp[MAX];

int main(){

    scanf("%d%d",&n,&k);

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

        scanf("%d",&no);

        vi.push_back(no);

        dp[no]=1;

    }



    dp[0]=0;



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

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

            if(i-vi[j]>0&&!dp[ i-vi[j] ]){

                dp[i]=1;

                break;

            }

        }

    }



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

    else printf("Second\n");







    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#define _CRT_SECURE_NO_WARNINGS

#include<bits/stdc++.h>

#include<iostream>

#include<algorithm>

#include<iomanip>

#include<string>

#include<cmath>

#include<vector>

#include<set>

#include<queue>

#include<stack>

#include<fstream>

#include<map>

#include<bitset>

#include<unordered_map>

#include<cstring>

#include<cctype>

using namespace std;

#define  ll long long

#define  ull unsigned long long

#define  ul unsigned long

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

#define sz(n) (int)n.size()

#define pb(s) push_back(s);

#define format(n) fixed<<setprecision(n)

#define finl "\n"

#define Mohammed_Atef_Hassan fast();

#define mod 1000000007

#define INF LLONG_MAX

#define PI acos(-1)

#define clr(dp,n) memset(dp,n,sizeof dp)

#define ex(n) return cout<<n<<finl,0;

int dx[] = { 0, 1, 0, -1, 1, 1, -1, -1 };

int dy[] = { 1, 0, -1, 0, 1, -1, 1, -1 };

ll fix_mod(ll x, ll y)

{

	return (y + x % y) % y;

}

void fast() {

	std::ios_base::sync_with_stdio(false);

	cin.tie(nullptr); cout.tie(nullptr);



#ifdef ONLINE_JUDGE

	//freopen("crosses.in", "r", stdin);



	//freopen("crosses.out", "w", stdout);

#endif

#ifndef ONLINE_JUDGE

	//freopen("input.in", "r", stdin);

	//freopen("output.out", "w", stdout);

#endif

}

vector<int>v;

int mem[(int)1e5 + 10][3];

int solve(int k, int c)

{

	int& ret = mem[k][c];

	if (~ret)return ret;

	for (int i = 0; i < v.size(); i++)

	{

		if (k >= v[i])

		{

			if (solve(k - v[i], c % 2 + 1) == c)return ret=c;

		}

	}

	return ret= c % 2 + 1;

}

int main()

{

	Mohammed_Atef_Hassan

		clr(mem, -1);

		int n, k;

	cin >> n >> k;

	v = vector<int>(n);

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

	cout << (solve(k, 1) == 1 ? "First" : "Second") << finl;

}

// Optimized solution to the same problem (faster):
#include<bits/stdc++.h>

using namespace std;

vector<int> vi;

int n, k, no;

const int MAX=1e5+3;

bool dp[MAX];

int main(){

    scanf("%d%d",&n,&k);

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

        scanf("%d",&no);

        vi.push_back(no);

        dp[no]=1;

    }



    dp[0]=0;



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

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

            if(i-vi[j]>0&&!dp[ i-vi[j] ]){

                dp[i]=1;

                break;

            }

        }

    }



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

    else printf("Second\n");







    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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";

}       


// Fastest known solution for this problem:
// Original C++ solution (slower):
// 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;

}


// Optimized solution to the same problem (faster):
// 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;

}




// Fastest known solution for this problem:
// Original C++ solution (slower):
// 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;

}


// Optimized solution to the same problem (faster):
// 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;

}




// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}


// Optimized solution to the same problem (faster):
#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;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}


// Optimized solution to the same problem (faster):
#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;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

    }

}




// Optimized solution to the same problem (faster):
#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;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int main()

{

    int n;

    cin>>n;

    int a[n],i,sum = 0;

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

    {

        cin>>a[i];

        sum += a[i];



    }

    sort(a,a+n);

    sum -= a[n-1];

    if(sum>a[n-1])

        cout<<"Yes\n";

    else

        cout<<"No\n";

   return 0;

}


// Optimized solution to the same problem (faster):
#include <cstdio>

int main() {

    int n = 0, t = 0, tot = 0, maxLen = 0;

    scanf("%d", &n);

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

        scanf("%d", &t);

        if (t > maxLen)

            maxLen = t;

        tot += t;

    }

    printf((maxLen * 2 < tot) ? "Yes" : "No");

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
/*

        ***Fresher***

    Md Mahfujur Rahman Khan

    Dept. of CSE

    CSE-28 Batch

    JU-48 Batch

    Jahangirnagar University



*/

#include<iostream>

#include<cstdio>

#include<string>

#include<vector>

#include<queue>

#include<sstream>

#include<cmath>

#include<algorithm>

#include<iomanip>

#include<functional>

#include<set>

#include<map>

#include<climits>

#include<numeric>

#include<utility>

using namespace std;

#define V_ vector

#define Q_ queue

#define S_ set

#define ST_ stack

#define M_ map

#define DQ_ deque



#define pii pair<ll,ll>

#define pci pair<char,ll>

#define psi pair<string, ll>

#define pis pair<ll,string>

#define pic pair<ll, char>



#define mii map<ll,ll>

#define msi map<string, ll>

#define mis map<ll, string>

#define mib map<ll,bool>

#define msb map<string,bool>



#define vi vector<ll>

#define vs vector<string>



#define ivi vector<ll> :: iterator

#define ivs vector<string> :: iterator

#define imii map<ll,ll> :: iterator

#define imsi map<string,ll> :: iterator

#define imis map<ll, string> :: iterator

#define imib map<ll, bool> :: iterator

#define imsb map<string, bool> :: iterator



#define FAST ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);



#define F first

#define S second

#define pi 2*acos(0.0)

#define PB(x) push_back(x)

#define PP(x) push(x)

#define RSZ(n) resize(n)

#define POB pop_back()

#define P_ pop()

#define CL_ clear()

#define LEN_ length()

#define SZ_ size()

#define CNT_ count()

#define FF first.first

#define FS first.second

#define SF second.first

#define SS second.second

#define B_ begin()

#define E_ end()

#define F_ front()

#define t_ top()

#define IN_ insert

#define ER_  erase

#define GT getline

#define NL_   "\n"

#define SP_ " "



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

#define fe(x, n) for(i = x; i <= n; i++)



#define ul unsigned long long int

#define ll long long int

#define  MAX 250000











int main()

{



 ll n, sum = 0, mx =0, t;

 cin >> n;

 while(n--)

 {

     cin >> t;

     sum+=t;

     mx = max(mx,t);

 }

 sum -= mx;

 if(sum > mx) cout <<"Yes";

 else cout <<"No";





    return 0;



}


// Optimized solution to the same problem (faster):
#include <cstdio>

int main() {

    int n = 0, t = 0, tot = 0, maxLen = 0;

    scanf("%d", &n);

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

        scanf("%d", &t);

        if (t > maxLen)

            maxLen = t;

        tot += t;

    }

    printf((maxLen * 2 < tot) ? "Yes" : "No");

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<iostream>

#include<cstdlib> 

#include<sstream>

#include<cstdio>

#include<stack>

#include<cstdio>

#include<map>

#include<set>

#include<queue>

#include<cstring>

#include<cmath>

#include<vector>

#include<algorithm>

using namespace std;

typedef long long LL;

#define me(a,b) memset(a,b,sizeof(a))

#define inf 0x3f3f3f3f

const int N=1111122;

const int M=200005;

int main()

{

    std::ios::sync_with_stdio(false);

    int n,i,j,m;

    cin>>n;

    int ans=0;

    int a[M];

    int maxx=0;

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

    {

        cin>>a[i];

        maxx=max(maxx,a[i]);

        ans+=a[i];

    }

    if(maxx<ans-maxx)cout<<"Yes"<<endl;

    else cout<<"No"<<endl;

    //system("pause");

    return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdio>

int main() {

    int n = 0, t = 0, tot = 0, maxLen = 0;

    scanf("%d", &n);

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

        scanf("%d", &t);

        if (t > maxLen)

            maxLen = t;

        tot += t;

    }

    printf((maxLen * 2 < tot) ? "Yes" : "No");

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
///   ***   ---   |||         In the name of ALLAH        |||   ---   ***   ///







#include<bits/stdc++.h>

using namespace std;





typedef long long ll;

typedef vector<int> vi;

typedef vector<ll> vl;

typedef vector<vi> vvi;

typedef vector<vl> vvl;

typedef pair<int,int> pii;

typedef pair<double, double> pdd;

typedef pair<ll, ll> pll;

typedef vector<pii> vii;

typedef vector<pll> vll;

typedef double dl;



#define endl '\n'

#define PB push_back

#define F first

#define S second

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

#define rall(a) (a).rbegin(),(a).rend()

#define sz(x) (int)x.size()



const double PI = acos(-1);

const double eps = 1e-9;

const int inf = 2000000000;

const ll infLL = 9000000000000000000;

#define mod 1000000007



#define mem(a,b) memset(a, b, sizeof(a) )

#define sqr(a) ((a) * (a))



#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

#define fraction() cout.unsetf(ios::floatfield); cout.precision(10); cout.setf(ios::fixed,ios::floatfield);

#define file() freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);



#define dbg(args...) do {cerr << #args << " : "; faltu(args); } while(0)

void faltu () {            cerr << endl;}

template < typename T, typename ... hello>void faltu( T arg, const hello &... rest) {cerr << arg << ' ';faltu(rest...);}



ll gcd ( ll a, ll b ) { return __gcd ( a, b ); }

ll lcm ( ll a, ll b ) { return a * ( b / gcd ( a, b ) ); }





main()

{

    optimize();

int n,i,j=0;

cin>>n;

ll a[n+1];

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

{

    cin>>a[i];

}

sort(a+1,a+n+1);

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

{

    j=j+a[i];

}

if(a[n]<j)

    cout<<"Yes"<<endl;

else

    cout<<"No"<<endl;































    return 0;

}




















































































// Optimized solution to the same problem (faster):
#include <cstdio>

int main() {

    int n = 0, t = 0, tot = 0, maxLen = 0;

    scanf("%d", &n);

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

        scanf("%d", &t);

        if (t > maxLen)

            maxLen = t;

        tot += t;

    }

    printf((maxLen * 2 < tot) ? "Yes" : "No");

    return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;



typedef long long ll;



main()

{

    int n, sum = 0;

    cin >> n;

    int arr[n];

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

        cin >> arr[i];

    }

    sort(arr, arr+n);

    for(int i = 0; i < n-1; i++){

        sum = sum + arr[i];

    }

    if(arr[n-1] < sum){

        cout << "Yes";

    }

    else{

        cout << "No";

    }



}











///promy_pompom

//hello world


// Optimized solution to the same problem (faster):
#include <cstdio>

int main() {

    int n = 0, t = 0, tot = 0, maxLen = 0;

    scanf("%d", &n);

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

        scanf("%d", &t);

        if (t > maxLen)

            maxLen = t;

        tot += t;

    }

    printf((maxLen * 2 < tot) ? "Yes" : "No");

    return 0;

}

// Fastest known solution for this problem: