import java.util.*; import java.text.SimpleDateFormat; import java.sql.Timestamp; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); String start = String.format("%02d", sc.nextInt())+String.format("%02d", sc.nextInt()); int K = sc.nextInt(); SimpleDateFormat sdf = new SimpleDateFormat("MMdd"); Calendar cal = Calendar.getInstance(); cal.setTime(sdf.parse(start)); HashSet set = new HashSet<>(); for(int i = 0; i < 7; i++){ for(char c : sdf.format(cal.getTime()).toCharArray()){ set.add(c); } cal.add(Calendar.DATE, 1); } System.out.println(set.size() >= K ? "Yes" : "No"); } }