h,m=map(int,input().split()) t=h*60+m print("Yes"if t<450 else "Late" if 450<=t<510 else "No")