fn main() { let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); let mut s: Vec<_> = s.trim().chars().collect(); let c = s.iter().filter(|&&d| d == '1').count(); s.dedup(); println!( "{}", if c == 2 || c > 2 && s.len() < 3 { "Yes" } else { "No" } ); }