stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#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;

		

}

// Faster C++ solution for the same problem (measured speedup: 5.29459377769326x):
#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;







}
// Slower C++ solution:
#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";



}


// Faster C++ solution for the same problem (measured speedup: 5.279215789855715x):
#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;







}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 5.291380237214849x):
#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;







}
// Slower C++ solution:
#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;

}


// Faster C++ solution for the same problem (measured speedup: 5.291064465486375x):
#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;







}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 5.236791518930605x):
#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;

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 5.308311027970612x):
#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;

}
// Slower C++ solution:
#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;

}

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

int main()

{

    int n,i,a[100000];

    scanf("%d",&n);

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

    {

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

    }

    int temp;

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

    {

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

        {

            if(a[i]>=a[j])

            {

                temp = a[i];

                a[i] = a[j];

                a[j] = temp;

            }

        }

    }

    int sum = 0;

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

    {

        sum += a[i];

    }

    if(sum <= a[n-1])

        printf("No\n");

    else

        printf("Yes\n");



}
// Slower C++ solution:
#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;

}

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

int main()

{

    int n,i,a[100000];

    scanf("%d",&n);

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

    {

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

    }

    int temp;

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

    {

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

        {

            if(a[i]>=a[j])

            {

                temp = a[i];

                a[i] = a[j];

                a[j] = temp;

            }

        }

    }

    int sum = 0;

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

    {

        sum += a[i];

    }

    if(sum <= a[n-1])

        printf("No\n");

    else

        printf("Yes\n");



}
// Slower C++ solution:
#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;

}

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

int main()

{

    int n,i,a[100000];

    scanf("%d",&n);

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

    {

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

    }

    int temp;

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

    {

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

        {

            if(a[i]>=a[j])

            {

                temp = a[i];

                a[i] = a[j];

                a[j] = temp;

            }

        }

    }

    int sum = 0;

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

    {

        sum += a[i];

    }

    if(sum <= a[n-1])

        printf("No\n");

    else

        printf("Yes\n");



}
// Slower C++ solution:
#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;

}

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

int main()

{

    int n,i,a[100000];

    scanf("%d",&n);

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

    {

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

    }

    int temp;

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

    {

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

        {

            if(a[i]>=a[j])

            {

                temp = a[i];

                a[i] = a[j];

                a[j] = temp;

            }

        }

    }

    int sum = 0;

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

    {

        sum += a[i];

    }

    if(sum <= a[n-1])

        printf("No\n");

    else

        printf("Yes\n");



}
// Slower C++ solution:
#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;

}

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

int main()

{

    int n,i,a[100000];

    scanf("%d",&n);

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

    {

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

    }

    int temp;

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

    {

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

        {

            if(a[i]>=a[j])

            {

                temp = a[i];

                a[i] = a[j];

                a[j] = temp;

            }

        }

    }

    int sum = 0;

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

    {

        sum += a[i];

    }

    if(sum <= a[n-1])

        printf("No\n");

    else

        printf("Yes\n");



}
// Slower C++ solution:
#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;

}

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

int main()

{

    int n,i,a[100000];

    scanf("%d",&n);

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

    {

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

    }

    int temp;

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

    {

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

        {

            if(a[i]>=a[j])

            {

                temp = a[i];

                a[i] = a[j];

                a[j] = temp;

            }

        }

    }

    int sum = 0;

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

    {

        sum += a[i];

    }

    if(sum <= a[n-1])

        printf("No\n");

    else

        printf("Yes\n");



}
// Slower C++ solution:
#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;

} 

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

int main()

{

    int n,i,a[100000];

    scanf("%d",&n);

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

    {

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

    }

    int temp;

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

    {

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

        {

            if(a[i]>=a[j])

            {

                temp = a[i];

                a[i] = a[j];

                a[j] = temp;

            }

        }

    }

    int sum = 0;

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

    {

        sum += a[i];

    }

    if(sum <= a[n-1])

        printf("No\n");

    else

        printf("Yes\n");



}
// Slower C++ solution:
#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;

}


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

int main()

{

    int n,i,a[100000];

    scanf("%d",&n);

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

    {

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

    }

    int temp;

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

    {

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

        {

            if(a[i]>=a[j])

            {

                temp = a[i];

                a[i] = a[j];

                a[j] = temp;

            }

        }

    }

    int sum = 0;

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

    {

        sum += a[i];

    }

    if(sum <= a[n-1])

        printf("No\n");

    else

        printf("Yes\n");



}
// Slower C++ solution:
#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;

}

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

int main()

{

    int n,i,a[100000];

    scanf("%d",&n);

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

    {

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

    }

    int temp;

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

    {

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

        {

            if(a[i]>=a[j])

            {

                temp = a[i];

                a[i] = a[j];

                a[j] = temp;

            }

        }

    }

    int sum = 0;

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

    {

        sum += a[i];

    }

    if(sum <= a[n-1])

        printf("No\n");

    else

        printf("Yes\n");



}
// Slower C++ solution:
#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;

}


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

int main()

{

    int n,i,a[100000];

    scanf("%d",&n);

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

    {

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

    }

    int temp;

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

    {

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

        {

            if(a[i]>=a[j])

            {

                temp = a[i];

                a[i] = a[j];

                a[j] = temp;

            }

        }

    }

    int sum = 0;

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

    {

        sum += a[i];

    }

    if(sum <= a[n-1])

        printf("No\n");

    else

        printf("Yes\n");



}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 3.514942821139346x):
#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;

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 3.5629468296935984x):
#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;

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 3.5175111569238897x):
#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;

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 3.5173711123953635x):
#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;

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 3.5710306260692755x):
#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;

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 3.5626653896322686x):
#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;

}
// Slower C++ solution:
#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;

} 

// Faster C++ solution for the same problem (measured speedup: 3.5550324550032935x):
#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;

}
// Slower C++ solution:
#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;

}


// Faster C++ solution for the same problem (measured speedup: 3.5627413429011265x):
#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;

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 3.562688807039748x):
#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;

}
// Slower C++ solution:
#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;

}


// Faster C++ solution for the same problem (measured speedup: 3.5546498333449987x):
#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;

}