#include using namespace std; #define int long long signed main(){ int N; cin>>N; int ans = 0; int best = 0; for(int i=0;i>g>>d; int x = g-30000*d; if(x > best){ ans = i+1; best = x; } } if(best*6 >= 3000000){ cout<<"YES"<