N,A,H,M,S=map(int,input().split()) if H*60*60+M*60+S+A*N>=24*60*60: print("Yes") else: print ("No")