print ("Yes") if int(input())%6 == 0 else print ("No")