#include #define rep(i, ss, ee) for (int i = ss; i < ee; ++i) using namespace std; void solve() { int N, M, ta = 0, pa = 0, tb, pb; cin >> N >> M; rep(i, 0, M) { cin >> tb >> pb; // abs(ta - tb) < abs(pa - pb) if (abs(pb - pa) > (tb - ta)) { cout << "No" << endl; break; } ta = tb; pa = pb; } cout << "Yes" << endl; } int main() { ios::sync_with_stdio(false); cin.tie(0); solve(); getchar(); }