print("Yes" if any(list(map(lambda a:int(a)%3==0,input().split()))) else "No")