h, m = io.read("*n", "*n") a = h * 60 + m if a < 450 then print("Yes") elseif a < 510 then print("Late") else print("No") end