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

}


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

}
// Slower C++ solution:
/*

        ***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;



}


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

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

}

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

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

}




















































































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

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


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

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

}

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

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

}


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



}
// Slower C++ solution:
/*

        ***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;



}


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



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

}

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



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

}




















































































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



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


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



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

}

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



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

} 

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



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

}

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



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

}

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

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

}

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







}