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