fn main() { proconio::input! { n: usize, a: [i64; n], } let total_diff = a[0] + a.iter() .zip(a.iter().skip(1)) .map(|(x, y)| (y - x).max(0)) .sum::(); if total_diff <= n as i64 { println!("Yes"); } else { println!("No"); } }