use std::io::*; use std::str::FromStr; fn main() { let mut buffer = String::new(); stdin().read_line(&mut buffer).ok(); let mut itr = buffer.split_whitespace().map(|x| i64::from_str(x).unwrap()); let (_n, m) = (itr.next().unwrap(), itr.next().unwrap()); let mut v = Vec::new(); for _i in 0..m { buffer.clear(); stdin().read_line(&mut buffer).ok(); let mut itr = buffer.split_whitespace().map(|x| i64::from_str(x).unwrap()); let (t, p) = (itr.next().unwrap(), itr.next().unwrap()); v.push((t, p)); } let mut ret = true; let mut t = 0; let mut pos = 0; for i in 0..v.len() { let diff_time = v[i].0 - t; let dist = (pos - v[i].1).abs(); if dist > diff_time { ret = false; } t = v[i].0; pos = v[i].1; } match ret { true => println!("Yes"), false => println!("No"), } }