data = [1 if int(idx)%3==0 else 0 for idx in input().split()] if 1 in data: print("Yes") else: print("No")