print(['No', 'Yes'][int(input().strip()) % 6 == 0])