#include typedef long long ll; typedef unsigned long long ull; #define FOR(i,a,b) for(int (i)=(a);i<(b);i++) #define REP(i,n) FOR(i,0,n) #define RANGE(vec) (vec).begin(),(vec).end() using namespace std; bool rangeIsCross(int s1, int e1, int s2, int e2) { return max(s1,s2) <= min(e1,e2); } class TheWall { public: void solve(void) { int N,M; cin>>N>>M; set> S; REP(i,N) { int l,r; cin>>l>>r; S.emplace(l,r); } int l = M; int r = -1; while (!S.empty()) { int l1,r1; tie(l1,r1) = *S.begin(); S.erase(S.begin()); if ( rangeIsCross(-1,r,l1,r1) ) { if ( rangeIsCross(M-1-r1,M-1-l1,l,M) ) { cout<<"NO"<solve(); delete obj; return 0; } #endif