use std::collections::HashSet; fn main() { let mut mdk = String::new(); std::io::stdin().read_line(&mut mdk).ok(); let mdk: Vec = mdk.trim().split_whitespace().map(|s| s.parse().unwrap()).collect(); let m = mdk[0]; let d = mdk[1]; let k = mdk[2]; let mut months = vec![m-1; 7]; let mut days = vec![d-1; 7]; let ends = vec![31,28,31,30,31,30,31,31,30,31,30,31]; for i in 1..7 { months[i] = (if days[i-1]+1 == ends[months[i-1]] { 1 } else { 0 } + months[i-1]) % 12; days[i] = if days[i-1]+1 == ends[months[i-1]] { 0 } else { 1 + days[i-1] }; } let cnt = (0..7).flat_map(|i| format!("{:02}{:02}", months[i]+1, days[i]+1).chars().collect::>()).collect::>(); if cnt.len() >= k { println!("Yes"); } else { println!("No"); } }