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