X = map(int,input().split()) for i in X: if i % 3 == 0: ans = 'Yes' break else:ans ='No' print(ans)