#include using namespace std; using ll=long long; #define rep2(i, a, n) for(int i = (a); i < (n); i++) #define rep(i, n) rep2(i,0,n) void in(){} template void in(Head&& head,Tail&&... tail){cin>>head;in(forward(tail)...);} void flagfunc3(bool flag){cout<<(flag?"Yes\n":"No\n");} int main(){ cin.tie(nullptr);ios_base::sync_with_stdio(false); ll n,m,t,p,a=0,b=0; in(n,m); bool flag=true; rep(i,m){ in(t,p); if(t-a