#include #define PB push_back #define MP make_pair #define REP(i,n) for (int i=0;i<(n);i++) #define FOR(i,a,b) for(int i=(a);i<(b);i++) #define ALL(a) (a).begin(),(a).end() using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair P; const int INF=1e9; const int MOD=100000; int B=1000000; int main(){ vector

V; int n,g,d; cin>>n; REP(i,n){ cin>>g>>d; V.PB(P(g-(d*30000),i)); } sort(V.begin(),V.end(),greater

()); int sum=V[0].first*6; if(sum<3000000){ cout<<"NO"<