import datetime def main(): m, d, k = map(int, input().split()) a = datetime.date(2022, m, d) st = set() for i in range(7): cur = a + datetime.timedelta(days=i) mm = str(cur.month).zfill(2) dd = str(cur.day).zfill(2) st |= set(list(mm + dd)) if len(st) >= k: print('Yes') else: print('No') if __name__ == "__main__": main()