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