use std::collections::VecDeque; fn main() { let mut p = String::new(); std::io::stdin().read_line(&mut p).ok(); let p = p.trim().chars().map(|c| c as usize - '0' as usize).collect::>(); if p.len() == 1 { if p[0] == 6 || p[0] == 7 { println!("Yes"); return; } } else if p.len() == 2 { if p[1] == 2 || p[1] == 3 || p[1] == 4 { if p[0] == 1 || p[0] == 7 || p[0] == 8 { println!("Yes"); return; } } } else { let n = p.len()-1; if p[n] == 2 || p[n] == 3 || p[n] == 4 { if p[0] == 1 || p[0] == 7 || p[0] == 8 { if n-1 == (1..n).filter(|&i| p[i] == 3 || p[i] == 4 || p[i] == 5).count() { println!("Yes"); return; } } } } println!("No"); }