l = list(map(int,input().split())) for i in l: if i % 3 == 0: print("Yes") exit() print("No")