x,y,z = map(int,input()) print("Yes" if x*y*z%3 == 0 else "No")