n=int(input()) c=[0]*6 for i in range(n): c[i%6]+=1 print(["No","Yes"][all(c[i]==c[i-1] for i in range(6))])