#include using namespace std; int main(){ int N,G,D; cin>>N; int m=-1; int index=0; for(int i=0;i>G>>D; if(m=3000000){ cout<<"YES"<