// No.1205 Eye Drops package main import ( "fmt" "sort" ) func main() { var n, m int fmt.Scan(&n, &m) type C struct { T int // time P int // position } mm := make([]C, m) for i := 0; i < m; i++ { fmt.Scan(&mm[i].T, &mm[i].P) } sort.Slice(mm, func(i, j int) bool { return mm[i].T < mm[j].T }) prev := C{T: 0, P: 0} ans := "Yes" for j := 0; j < m; j++ { t := mm[j].T - prev.T p := max(prev.P-mm[j].P, mm[j].P-prev.P) - t if p > 0 { ans = "No" break } prev.P = mm[j].P prev.T = mm[j].T } fmt.Println(ans) }