from collections import Counter from datetime import datetime, timedelta def main(): M, D, K = map(int, input().split()) today_ = datetime(year=2022, month=M, day=D) week = [today_ + timedelta(days=days) for days in range(7)] week_str = list(map(lambda day: day.strftime("%m/%d"), week)) week_str_join = "".join(week_str) day_str_counter = Counter(week_str_join) if len(list(filter(bool, (day_str_counter[str(day_num)] for day_num in range(10))))) >= K: print("Yes") else: print("No") if __name__ == "__main__": main()