H,M = map(str,input().split()) H = H.zfill(2) M = M.zfill(2) HM = int(H+M) print("Yes" if HM < 730 else "No")