print('No' if int(input())%6 else 'Yes')