import static java.lang.System.err; import java.util.Calendar; import java.util.HashSet; public class Main { public static void main(String[] args) { java.io.PrintWriter out = new java.io.PrintWriter(System.out); new Main(out); out.flush(); err.flush(); } public Main(java.io.PrintWriter out) { try (java.util.Scanner sc = new java.util.Scanner(System.in)) { int M = sc.nextInt(), D = sc.nextInt(), K = sc.nextInt(); HashSet set = new HashSet<>(); for (int i = 0;i < 7;++ i) { Calendar calendar = Calendar.getInstance(); calendar.set(2022, M - 1, D); calendar.add(Calendar.DAY_OF_MONTH, i); String date = String.format("%02d/%02d", calendar.get(Calendar.MONTH) + 1, calendar.get(Calendar.DAY_OF_MONTH)); err.println(date); for (char d = '0';d <= '9';++ d) if (date.contains(d + "")) set.add(d); } out.println(set.size() >= K ? "Yes" : "No"); } } }