use proconio::input; fn main() { input! { mut ss: [String; 3], } ss.sort_unstable(); let colors_by_contest: [Vec<&'static str>; 3] = [ vec![ "gray", "brown", "green", "cyan", "blue", "yellow", "orange", "red", ], vec!["gray", "green", "blue", "yellow", "red"], vec!["gray", "green", "cyan", "blue", "violet", "orange", "red"], ]; let mut cnt = 0_usize; for color1 in &colors_by_contest[0] { for color2 in &colors_by_contest[1] { for color3 in &colors_by_contest[2] { let mut colors = [color1, color2, color3].map(|color| color.to_string()); colors.sort_unstable(); if colors == *ss { cnt += 1; } } } } println!("{}", if cnt == 1 { "Yes" } else { "No" }); }