a = int(input()) if a%90 == 0: print("YES") else: print("No")