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

using namespace std;

void solveA()

{

  long long a,b,tem;

  cin>>a>>b;

  tem=(a+b);

  if(tem%2==0)

  {

    cout<<tem/2<<endl;

  }

  else

  {

    cout<<"IMPOSSIBLE"<<endl;

  }

}

void solveB()

{

  int n,i,j,count;

  cin>>n;

  int ar[n];

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

  {

    cin>>ar[i];

  }

  j=1;

  count=0;

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

  {

    if(ar[i]!=j)

    {

      count++;

    }

    if(count>2)

    {

      cout<<"NO"<<endl;

      return;

    }

    j++;

  }

  cout<<"YES"<<endl;

}

void solveC()

{

  int a,b,x,y;

  cin>>a>>b;

  x=max(a,b);

  y=min(a,b);

  if((x-y)>=2)

  {

    cout<<2*x-1<<endl;

  }

  else

  {

    cout<<x+y<<endl;

  }

}

void solveD()

{

  int n,i,j;

  cin>>n;

  int ar[n];

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

  {

    cin>>ar[i];

  }

  int count=n;

  for(i=n-1;i>=0;i--)

  {

    for(j=i-1;j>=0;j--)

    {

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

      {

        count--;

        break;

      }

    }

  }

  cout<<count<<endl;

}

void solveE()

{

  int h,w,x,y,H,W;

  cin>>H>>W;

  cin>>h>>w;

  x=h*W;

  y=(H-h)*w;

  cout<<(H*W)-(x+y)<<endl;

}

void solveF()

{

  int n,m,c,i,j;

  cin>>n>>m>>c;

  int b[m];

  int ar[n][m];

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

  {

    cin>>b[i];

  }

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

  {

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

    {

      cin>>ar[i][j];

    }

  }

  int count=0;

  int sum;

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

  {

    sum=0;

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

    {

      sum=sum+ar[i][j]*b[j];

    }

    if((sum+c)>0)

    {

      count++;

    }

  }

  cout<<count<<endl;

}

void solveG()

{

  int a,b,c,tem;

  cin>>a>>b>>c;

  tem=b/a;

  if(tem>c)cout<<c<<endl;

  else cout<<tem<<endl;

}

void solveH()

{

  int a,b,c,tem,i;

  cin>>a>>b>>c;

  tem=min(a,b);

  vector<int>vec;

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

  {

    if(a%i==0&&b%i==0)

    {

      vec.push_back(i);

    }

  }

  cout<<vec[vec.size()-c]<<endl;

}

void solveI()

{

  double t,x;

  cin>>t>>x;

  cout<<fixed<<setprecision(10)<<t/x<<endl;

}

void solveJ()

{

  int n,i;

  cin>>n;

  int ar[n];

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

  {

    cin>>ar[i];

  }

  sort(ar,ar+n);

  int sum=0;

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

  {

    sum=sum+ar[i];

  }

  if(ar[n-1]<sum)cout<<"Yes"<<endl;

  else cout<<"No"<<endl;

}

int main()

{

  // solveA();

  //solveB();

  // solveC();

  // solveD();

// solveE();

 //solveF();

// solveG();

//solveH();

//solveI();

solveJ();

  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<vector>

#include<cstdio>

#include<stdio.h>

using namespace std;

typedef long long ll;



const int mod = 1e9+7;



int main(){

	ios::sync_with_stdio(false);

	int n,sum = 0,maxnum = 0,curnum;

	cin >> n; 	

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

		cin >> curnum;

		maxnum = curnum > maxnum ? curnum:maxnum;

		sum += curnum;

	}

	if(sum-maxnum > maxnum)printf("Yes");

	else printf("No");

	

	return 0;

} 

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

int main()

{



int n,C,i,sum=0,max;

scanf("%d",&n);

int A[n];

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

{

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

sum=sum+A[i]; 

}

max=A[0];

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

{

  if(max<A[i])

  max=A[i];

}

C=sum-max;

if(C>max) printf("Yes\n");

else printf("No\n");

return 0;



}

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

using namespace std;

int sumfun(int a[],int n){

	int i,sum=0;

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

		sum+=a[i];

	return sum;

}



int max(int a[],int n){

	int f=a[0];

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

		if(a[i]>f)

			f=a[i];

	return f;

}



int main(){

	int N;

	cin>>N;

	int a[10]={0};

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

		cin>>a[i];

	}

	int sum=sumfun(a,N),Max=max(a,N);

	if(Max<sum-Max)

		cout<<"Yes"<<endl;

	else

		cout<<"No"<<endl;

	return 0;

}

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

int main()

{



int n,C,i,sum=0,max;

scanf("%d",&n);

int A[n];

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

{

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

sum=sum+A[i]; 

}

max=A[0];

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

{

  if(max<A[i])

  max=A[i];

}

C=sum-max;

if(C>max) printf("Yes\n");

else printf("No\n");

return 0;



}

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

#include <algorithm>



using std::cin;

using std::cout;

using std::endl;

using std::sort;



int main()

{

    int n,sum=0;

    cin>>n;

    int a[n];

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

    {

        cin>>a[i];

        sum+=a[i];

    }

    sort(a,a+n);

    sum-=a[n-1];



    if(a[n-1]<sum)

    {

        cout<<"Yes";

    }

    else

    {

        cout<<"No";

    }

    

    return 0;

}

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

int main(){

	int n,x,b=0,sum=0;

	scanf("%d",&n);

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

		scanf("%d",&x);

		if(b<x) b=x;

		sum+=x;

	}

	if(2*b<sum) printf("Yes");

	else printf("No");

	return 0;

}

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

#include <vector>

#include <algorithm>

using namespace std;

int main(){

	int n,m;

	vector<int> sides;

	cin>>n;

	for(vector<int>::size_type i=0;i!=n;++i){

		cin>>m;

		sides.push_back(m);

	}

	sort(sides.begin(),sides.end());

	int sum=0;

	for(vector<int>::size_type i=0;i!=n-1;++i){

		sum+=sides[i];

	}

	if(sum>sides[n-1])

		cout<<"Yes";

	else

		cout<<"No";

	return 0;

		

}

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

int main()

{

    int a,b,n,i,j,x,y,sum=0;

    scanf("%d",&n);

    int array[n];

    scanf("%d",&array[0]);

    a=array[0];

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

        {

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

            if(a<array[i])

                {

                    a=array[i];

                }





        }

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

        {

            sum=sum+array[i];

        }

    sum=sum-a;

    if(a<sum)

        printf("Yes");

    else

        printf("No");



    return 0;







}


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

#include <vector>;

using namespace std;

int main()

{

    int a[10],N,maxi,j,i,sum;

    cin>>N;

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

        cin>>j;

        a[i-1]=j;

    }



    maxi=a[0];

    sum=a[0];

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

        sum+=a[i];

        if(a[i]>=a[i-1])

            maxi=a[i];

        else

            a[i]=a[i-1];



    }

    if(maxi<(sum-maxi)){

        cout<<"Yes";

    }

    else

        cout<<"No";



}


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

int main()

{

    int a,b,n,i,j,x,y,sum=0;

    scanf("%d",&n);

    int array[n];

    scanf("%d",&array[0]);

    a=array[0];

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

        {

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

            if(a<array[i])

                {

                    a=array[i];

                }





        }

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

        {

            sum=sum+array[i];

        }

    sum=sum-a;

    if(a<sum)

        printf("Yes");

    else

        printf("No");



    return 0;







}


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

using namespace std;

int main() {

	int n;

	cin >> n;

	int a[10],max=0,sum=0;

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

		cin >> a[i];

		if (max < a[i])

			max = a[i];

		sum += a[i];

	}

	if (sum - max > max)

		cout << "Yes" << endl;

	else

		cout << "No" << endl;

	return 0;

}

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

int main()

{

    int a,b,n,i,j,x,y,sum=0;

    scanf("%d",&n);

    int array[n];

    scanf("%d",&array[0]);

    a=array[0];

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

        {

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

            if(a<array[i])

                {

                    a=array[i];

                }





        }

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

        {

            sum=sum+array[i];

        }

    sum=sum-a;

    if(a<sum)

        printf("Yes");

    else

        printf("No");



    return 0;







}


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

using namespace std;

int main()

{

 int n, in, sum, max;

 max = sum=0;

 cin >> n;

 while (n--)

 {

  cin >> in;

  sum += in;

  if (in > max) max = in;

 }

 sum -= max;

 if (max < sum) cout << "Yes" << endl;

 else cout << "No" << endl;

 return 0;

}


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

int main()

{

    int a,b,n,i,j,x,y,sum=0;

    scanf("%d",&n);

    int array[n];

    scanf("%d",&array[0]);

    a=array[0];

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

        {

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

            if(a<array[i])

                {

                    a=array[i];

                }





        }

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

        {

            sum=sum+array[i];

        }

    sum=sum-a;

    if(a<sum)

        printf("Yes");

    else

        printf("No");



    return 0;







}


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

using namespace std;



int n;

const int maxn=5000;

int a[maxn];

int sum,mx;



int main()

{

	scanf("%d",&n);

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

	scanf("%d",&a[i]),sum+=a[i],mx=max(mx,a[i]);

	if(sum-mx>mx) printf("Yes\n");else printf("No\n"); 

	return 0;

}

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

#include <algorithm>

using namespace std;



int n, mx, sum;



int main()

{

	scanf("%d", &n);

	for (int i = 1, x; i <= n; i ++)

	{

		scanf("%d", &x);

		mx = max(mx, x);

		sum += x;

	}

	puts(mx * 2 < sum ? "Yes" : "No");

	return 0;

}

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

using namespace std;

int main ()

{

	int a, result{0}, max{0}, n;

	cin>>n;

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

	{

		cin>>a;

		result+=a;

		if (max<a) max=a;

	}

	if (max<result-max) cout<<"Yes"<<endl;

	else cout<<"No"<<endl;

	return 0;

}

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

#include <algorithm>

using namespace std;



int n, mx, sum;



int main()

{

	scanf("%d", &n);

	for (int i = 1, x; i <= n; i ++)

	{

		scanf("%d", &x);

		mx = max(mx, x);

		sum += x;

	}

	puts(mx * 2 < sum ? "Yes" : "No");

	return 0;

}

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

using namespace std;

int main()

{

	int n = 0,ans = 0,max = 0,s = 0;

	cin >> n;

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

	{

		cin >> s;

		max = max > s ? max : s;

		ans += s;

	}

	if(ans > 2 * max)

		printf("Yes\n");

	else

		printf("No\n");

	return 0;

}

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

#define size 115

int main()

{

	int N,max=-1,i,l[size],total=0;

	scanf("%d",&N);

	if(N>=3)

	{

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

		{

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

			total+=l[i];

		}

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

		{

			if(l[i]>max&&l[i]>0)

				{

					max=l[i];

				}

			else

				{

					

				}

			

		}

		total-=max;

	if(max<total)

		{

			printf("Yes\n");

		}

	else

		{

			printf("No\n");

		}

	}

	else

		{

			printf("No\n");

		}

	return 0;

}

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

using namespace std;

int main()

{

	int n,ans = 0,max = 0,s;

	cin >> n;

	while(n --)

	{

		cin >> s;

		max = max > s ? max : s;

		ans += s;

	}

	if(ans > 2 * max)

		printf("Yes\n");

	else

		printf("No\n");

	return 0;

}

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

#define size 115

int main()

{

	int N,max=-1,i,l[size],total=0;

	scanf("%d",&N);

	if(N>=3)

	{

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

		{

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

			total+=l[i];

		}

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

		{

			if(l[i]>max&&l[i]>0)

				{

					max=l[i];

				}

			else

				{

					

				}

			

		}

		total-=max;

	if(max<total)

		{

			printf("Yes\n");

		}

	else

		{

			printf("No\n");

		}

	}

	else

		{

			printf("No\n");

		}

	return 0;

}

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

#define ll long long

using namespace std;

int main()

{

	int n;

	cin>>n;

	vector<int>v(n);

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

	{

		cin>>v[i];

	}

	sort(v.rbegin(),v.rend());

	int sum=0;

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

	{

		sum=sum+v[i];

	}

	if(sum>v[0])

	{

		cout<<"Yes"<<endl;

	}

	else

	{

		cout<<"No"<<endl;

	}

	return 0;

}

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

#define size 115

int main()

{

	int N,max=-1,i,l[size],total=0;

	scanf("%d",&N);

	if(N>=3)

	{

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

		{

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

			total+=l[i];

		}

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

		{

			if(l[i]>max&&l[i]>0)

				{

					max=l[i];

				}

			else

				{

					

				}

			

		}

		total-=max;

	if(max<total)

		{

			printf("Yes\n");

		}

	else

		{

			printf("No\n");

		}

	}

	else

		{

			printf("No\n");

		}

	return 0;

}

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

using namespace std;



int main()

{

    int n = 0;

    int edge = 0;

    int max,count = 0;

    cin >> n;

    while(n > 0)

    {

        cin >> edge;

        if(edge > max)

            max = edge;

        count += edge;

        --n;

    }

    if(count > (max << 1))

        cout << "Yes" << endl;

    else

        cout << "No" << endl;

}

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

#define size 115

int main()

{

	int N,max=-1,i,l[size],total=0;

	scanf("%d",&N);

	if(N>=3)

	{

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

		{

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

			total+=l[i];

		}

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

		{

			if(l[i]>max&&l[i]>0)

				{

					max=l[i];

				}

			else

				{

					

				}

			

		}

		total-=max;

	if(max<total)

		{

			printf("Yes\n");

		}

	else

		{

			printf("No\n");

		}

	}

	else

		{

			printf("No\n");

		}

	return 0;

}

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

#include<algorithm>

using namespace std;

int main()

{

	int n,temp,m=0,sum=0;

	cin >> n;

	while(n)

	{

		cin >> temp;

		sum += temp;

		m = max(m, temp);

		n--;

	}

	sum -= m;

	m<sum ? cout << "Yes" : cout << "No";

	return 0;

} 

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

#define size 115

int main()

{

	int N,max=-1,i,l[size],total=0;

	scanf("%d",&N);

	if(N>=3)

	{

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

		{

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

			total+=l[i];

		}

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

		{

			if(l[i]>max&&l[i]>0)

				{

					max=l[i];

				}

			else

				{

					

				}

			

		}

		total-=max;

	if(max<total)

		{

			printf("Yes\n");

		}

	else

		{

			printf("No\n");

		}

	}

	else

		{

			printf("No\n");

		}

	return 0;

}

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

using namespace std;

int main()

{

	int n, in, sum, max;

	max = sum=0;

	cin >> n;

	while (n--)

	{

		cin >> in;

		sum += in;

		if (in > max) max = in;

	}

	sum -= max;

	if (max < sum) cout << "Yes" << endl;

	else cout << "No" << endl;

	return 0;

}


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

#define size 115

int main()

{

	int N,max=-1,i,l[size],total=0;

	scanf("%d",&N);

	if(N>=3)

	{

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

		{

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

			total+=l[i];

		}

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

		{

			if(l[i]>max&&l[i]>0)

				{

					max=l[i];

				}

			else

				{

					

				}

			

		}

		total-=max;

	if(max<total)

		{

			printf("Yes\n");

		}

	else

		{

			printf("No\n");

		}

	}

	else

		{

			printf("No\n");

		}

	return 0;

}

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

#include <algorithm>



using std::cout;    using std::cin;

using std::endl;	using std::max;



int main() {

	

	int N;

	cin >> N;

	

	int m = 0, sum = 0;

	

	for (int i = 0; i != N; ++i) {

		

		int x;

		cin >> x;

		

		sum += x;

		m = max(m, x);

	}

	

	if (sum > 2 * m)

		cout << "Yes" << endl;

	else

		cout << "No" << endl;

		

	return 0;

}

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

#define size 115

int main()

{

	int N,max=-1,i,l[size],total=0;

	scanf("%d",&N);

	if(N>=3)

	{

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

		{

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

			total+=l[i];

		}

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

		{

			if(l[i]>max&&l[i]>0)

				{

					max=l[i];

				}

			else

				{

					

				}

			

		}

		total-=max;

	if(max<total)

		{

			printf("Yes\n");

		}

	else

		{

			printf("No\n");

		}

	}

	else

		{

			printf("No\n");

		}

	return 0;

}

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

#include<iostream>

using namespace std;

int main()

{

    int b;

    int temp=0;

    cin>>b;

    int a[b];

    long long int sum=0;

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

        cin>>a[i];

    }

    //cout<<a[0];

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

        for(int j=i+1;j<b;j++){

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

                temp=a[i];

                a[i]=a[j];

                a[j]=temp;

            }

        }

    }

    //cout<<a[0]<<endl;

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

        sum=sum+a[i];

    }

    if(a[0]<sum){

        cout<<"Yes\n";

    }

    else{

        cout<<"No\n";

    }

    return 0;

}


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

#define size 115

int main()

{

	int N,max=-1,i,l[size],total=0;

	scanf("%d",&N);

	if(N>=3)

	{

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

		{

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

			total+=l[i];

		}

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

		{

			if(l[i]>max&&l[i]>0)

				{

					max=l[i];

				}

			else

				{

					

				}

			

		}

		total-=max;

	if(max<total)

		{

			printf("Yes\n");

		}

	else

		{

			printf("No\n");

		}

	}

	else

		{

			printf("No\n");

		}

	return 0;

}

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

#include <stdlib.h>

#define size 1000000



int main()

{

    int n,i,c = 0,a[size],b = 0;



    scanf("%d",&n);

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



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



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

        {

        c += a[i];

        if(a[i]>b)

           b = a[i];

        }



      if((c-b)>b)printf("Yes\n");

      else printf("No\n");

    return 0;

}


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

#define size 115

int main()

{

	int N,max=-1,i,l[size],total=0;

	scanf("%d",&N);

	if(N>=3)

	{

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

		{

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

			total+=l[i];

		}

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

		{

			if(l[i]>max&&l[i]>0)

				{

					max=l[i];

				}

			else

				{

					

				}

			

		}

		total-=max;

	if(max<total)

		{

			printf("Yes\n");

		}

	else

		{

			printf("No\n");

		}

	}

	else

		{

			printf("No\n");

		}

	return 0;

}

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

#include <list>



using namespace std;



int main(){

	int x, n, l = 0, sum = 0;

	list<int> array;

	cin >> n;

	while (cin >> x){

		array.push_back(x);

		if (x > l)

			l = x;

		sum += x;

	}

	list<int>::iterator it;

	if (sum > 2 * l)cout << "Yes" << endl;

	else cout << "No" << endl;

	system("pause");

	return 0;

}

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

#include<stdlib.h>

#include<math.h>

#include<ctype.h>

#include<string.h>



#define size 100005



int main()

{

    int n, i, arr[size], sum=0, max;

    scanf("%d", &n);

    max=0;



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

    {

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

        sum = sum + arr[i];

        if(arr[i]>max)

            max = arr[i];

    }



    if((sum-max)>max)

        printf("Yes\n");

    else

        printf("No\n");



    return 0;

}


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

#include <algorithm>

#include <numeric>



using namespace std;



int main(){

    int sides[10];

    int datalen = 0;

    int largest;

    int sum;

    int n;



    cin >> n;



    while (cin >> sides[datalen++] &&(n-- > 1))

        ;

    largest = *std::max_element(sides, sides+datalen);

    sum = std::accumulate(sides, sides+datalen, 0);



    if ((sum - largest) > largest) {

        cout << "Yes";

    } else {

        cout << "No";

    }



    return 0;



}

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

#include<stdlib.h>

#include<math.h>

#include<ctype.h>

#include<string.h>



#define size 100005



int main()

{

    int n, i, arr[size], sum=0, max;

    scanf("%d", &n);

    max=0;



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

    {

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

        sum = sum + arr[i];

        if(arr[i]>max)

            max = arr[i];

    }



    if((sum-max)>max)

        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,m,sum=0,s,i;

    cin>>n;

    int arr[n];

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

    {

        cin>>arr[i];

    }

    m=*max_element(arr,arr+n);



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

    {

        sum += arr[i];

    }

    s=sum-m;

    if(s>m)

    {

        cout<<"Yes"<<endl;

    }

    else

    {

        cout<<"No"<<endl;

    }

    return 0;

}


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

#include<stdlib.h>

#include<math.h>

#include<ctype.h>

#include<string.h>



#define size 100005



int main()

{

    int n, i, arr[size], sum=0, max;

    scanf("%d", &n);

    max=0;



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

    {

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

        sum = sum + arr[i];

        if(arr[i]>max)

            max = arr[i];

    }



    if((sum-max)>max)

        printf("Yes\n");

    else

        printf("No\n");



    return 0;

}


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

#include <cstdio>

#include <cstring>

#include <algorithm>

#include <queue>



#define ll long long



using namespace std;



const int N = 60;

const int mod = 1e9 + 7;



inline int read() {

	int jg = 0, jk = getchar() - '0', f = 1;

	while(jk < 0 || jk > 9) {

	    if(jk == '-' - '0')  f = -1;

		jk = getchar() - '0';

	}

	while(jk >= 0 && jk <= 9)

		jg *= 10, jg += jk, jk = getchar() - '0';

	return jg * f;

}



int n, mx, sum;

 

int main() {

	//freopen("a.txt", "r", stdin);

    n = read();

	for(int i = 1, l; i <= n; ++i) {

		l = read();

		sum += l;

		mx = max(mx, l);

	}

	if(sum > 2 * mx)  printf("Yes");

	else  printf("No");

    return 0;

}

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

#include<stdlib.h>

#include<math.h>

#include<ctype.h>

#include<string.h>



#define size 100005



int main()

{

    int n, i, arr[size], sum=0, max;

    scanf("%d", &n);

    max=0;



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

    {

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

        sum = sum + arr[i];

        if(arr[i]>max)

            max = arr[i];

    }



    if((sum-max)>max)

        printf("Yes\n");

    else

        printf("No\n");



    return 0;

}


// Fastest known solution for this problem: