gets i=0 puts$<.map{|i|i.split.map &:to_f}.any?{|j|i+=1;g,d=*j;g-3e4*d>=5e5}?['YES',[i]*6]:'NO'