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 dist = pos - v[i].0; let diff_time = t - v[i].1; if dist > diff_time { ret = false; } t = v[i].0; pos = v[i].1; } match ret { true => println!("Yes"), false => println!("No"), } }