import datetime M, D, K = map(int, input().split()) S = set() now = datetime.datetime(2023, M, D) for i in range(7): s = now.strftime("%m%d") for ss in s: S.add(ss) now = now + datetime.timedelta(days=1) if len(S)>=K: print("Yes") else: print("No")