n = int(input()) l = [0]*n for i in range(n): j = (i%6)+1 j -= 1 l[j] += 1 #print(l) if min(l) == max(l): print('Yes') else: print('No')