n = int(input()) l = [x%6+1 for x in list(range(n))] print(["No","Yes"][len(l)%len(set(l))==0])