import datetime M,D,K=map(int,input().split()) lis = ['0','1','2','3','4','5','6','7','8','9'] dt=datetime.datetime(2022,M,D,0,0,0,0) allday = "" cnt = 0 for i in range(7): allday+=str(dt)[5:10] dt+=datetime.timedelta(days=1) for i in range(10): if lis[i] in allday: cnt += 1 if cnt >= K: print("Yes") else: print("No")