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