N,M=gets.split.map(&:to_i) A=[0]*(M+1) N.times{l,r=gets.split.map(&:to_i);A[l]+=1;A[r+1]-=1} M.times{|i|A[i+1]+=A[i]} puts M.times.all?{|i|A[i]+A[M-i]>2}?:YES: :NO