N , A, H, M, S = map(int,input().split()) sec = N * A check = (H * 60 * 60) + (M * 60) + S if check + sec < 86400: print('No') else: print('Yes')