#include #include #include #include #include #define ll long long using namespace std; const int maxn=1e5+100; struct node{ int id; ll w, carry; bool operator < (const node& x)const{ return w q; int main(){ ios::sync_with_stdio(false); int N;cin>>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; int last=N; 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<=last;i++){ q.push(box[i]); } last=L-1; if(q.empty()) break; node x=q.top(); q.pop(); sum-=x.w; cnt+=1; } if(cnt==N){ cout<<"Yes"<