import datetime m,d,k=map(int,input().split()) d=datetime.date(2016, m, d) all="" for i in range(7): s="%02d%02d" % (d.month,d.day) all+=s d=d + datetime.timedelta(days=1) hs={} for e in all: hs[e]=0 if len(hs)>=k: print("Yes") else: print("No")