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