import datetime M,D,K = map(int,input().split()) se = set() A = datetime.date(2022,M,D) for i in range(7): B = A + datetime.timedelta(i) C = B.strftime("%m%d") for j in range(len(C)): se.add(C[j]) if len(se) >= K: print("Yes") else: print("No")