if all(i % 3 for i in map(int, input().split())): print('No') else: print('Yes')