use std::io::{Read, Write}; struct Scanner { bytes: std::io::Bytes, buf: Vec } impl Scanner { fn new(r: R) -> Scanner { Scanner { bytes: r.bytes(), buf: Vec::new() } } fn next(&mut self) -> &str { self.buf = { self.bytes.by_ref().map(|b| b.unwrap()) .skip_while(|b| b.is_ascii_whitespace()) .take_while(|b| !b.is_ascii_whitespace()) .collect::>() }; unsafe { std::str::from_utf8_unchecked(&self.buf) } } } macro_rules! scan { ($sc:expr, [$t:tt; $n:expr]) => ( (0..$n).map(|_| scan!($sc, $t)).collect::>() ); ($sc:expr, ($($t:tt),*)) => (($(scan!($sc, $t)),*)); ($sc:expr, Usize1) => (scan!($sc, usize) - 1); ($sc:expr, Bytes) => ($sc.next().bytes().collect::>()); ($sc:expr, Chars) => ($sc.next().chars().collect::>()); ($sc:expr, $t:ty) => ($sc.next().parse::<$t>().unwrap()); } fn run(mut sc: Scanner, mut wr: W) { let (x, y, z) = scan!(sc, (i64, i64, i64)); if (x + y + z) % 3 == 0 { writeln!(wr, "Yes").ok(); } else { writeln!(wr, "No").ok(); } } fn main() { let (stdin, stdout) = (std::io::stdin(), std::io::stdout()); let sc = Scanner::new(std::io::BufReader::new(stdin.lock())); let wr = std::io::BufWriter::new(stdout.lock()); run(sc, wr); }