import datetime m,d,k = map(int,input().split()) day = datetime.date(year=1,month=m,day=d) s = set() for i in range(7): delta = datetime.timedelta(i) s = s | set((day+delta).strftime("%m%d")) if len(s) >= k: print("Yes") else: print("No")