n,a,h,m,s=gets.split.map{|x|x.to_i} l = s+60*m+60*60*h b = 24*60*60 if b-l<=a*n then puts "Yes" else puts "No" end