#include #include #include #include using namespace std; using ll = long long; using ull = unsigned long long; #define rep(i,n) for(int i=0; i<(n); i++) int N; vector> A; int main(){ cin >> N; A.resize(N); rep(i,N) cin >> A[i].second >> A[i].first; ll sumW = 0; rep(i,N) sumW += A[i].second; rep(i,N) A[i].first = sumW - A[i].first - A[i].second; sort(A.begin(),A.end()); ll nowsumW = 0; rep(i,N){ if(nowsumW < A[i].first){ cout << "No\n"; return 0; } nowsumW += A[i].second; } cout << "Yes\n"; return 0; } struct ios_do_not_sync{ ios_do_not_sync(){ ios::sync_with_stdio(false); cin.tie(nullptr); } } ios_do_not_sync_inst;