#include #include #include #include #include #define ll long long using namespace std; const int maxn=1e5+100; struct node{ ll w, carry; }; bool cmp(node a,node b){ return a.carry>N; ll sum=0; for(int i=1;i<=N;i++){ cin>>box[i].w>>box[i].carry; box[i].carry+=box[i].w; sum+=box[i].w; } sort(box+1,box+1+N,cmp); int cnt=0; while(cnt>1; if(box[mid].carry>=sum){ R=mid-1; }else{ L=mid+1; } } ll w=-1; int id=-1; for(int i=L;i<=N-cnt;i++){ if(box[i].w>w){ w=box[i].w; id=i; } } if(w==-1){ break; } sum-=w; swap(box[N-cnt],box[id]); cnt+=1; } if(cnt==N){ cout<<"Yes"<