print(["No","yes"][int(input())%6==0])